Weedpacket;11027925 wrote:There's no way it could
Welllllll....not saying this is how things should be (and they probably shouldn't be), but it would seem that certain text editors seem to avoid putting those bytes at the beginning of one's edit window when encountering a BOM at the beginning of a text file and additionally make the assumption that the bytes that follow represent UTF-8 text (or something). While it is entirely possible that someone might make a poorly designed PHP file that starts with these bytes:
\xEF\xBB\xBF are the bytes that represent a BOM which in some cases...
<?php
/**
* some-fing-template.php
*/
?>
the odds of this happening seem fairly remote. I find it difficult to imagine any other circumstances under which a PHP file would start with a BOM. I expect I'm headed for some more mind-hurting realizations thanks to Weedpacket's generous donation of know-how here.
It seems odd to me that there aren't distinct file suffixes for UTF8 text files and ISO text files and LATIN-1 text files and so on. On the other hand, from a PHP perspective, I seem to recall that the entirety of PHP's syntax is expressed in ASCII characters and therefor any byte sequences intended as UTF-8 which happen to live in a PHP file would either have to be a) output living outside the <?php ?> tags or b) somewhere in a quoted string in which case PHP would treat them as precisely the bytes that they are without any care in the world as to that they represent.