开发者

Cannot start session if documents are in different encoding

I think i encountered a PHP bug When my header file is in UTF-8 encoding and my index.php 开发者_开发技巧file is in ANSI PHP gives " headers already sent " error . Is this normal ? and if yes , can you explain why ?


Maybe your editor is writing a UTF-8 BOM to the beginning of the "header" file, and PHP, not knowing what the BOM is, considers it as data to output and does that annoying thing PHP does?

There's a long-standing WONTFIX bug on PHP's mis-handling of the BOM. Probably your only workaround is to find an editor that writes UTF-8 without it (which, actually, is most of them.)


I've seen this before. Somewhere outside of the the encoding is generating some whitespace. It was a pain and a half to track down.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜