Re: PHP's handling of BOM (byte order mark)
| From: | Andreas Heigl | Date: | Tue, 31 May 2016 07:42:12 +0000 |
| Subject: | Re: PHP's handling of BOM (byte order mark) | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-93649@lists.php.net to get a copy of this message | ||
Hi All.
As the BOM is only relevant on UTF-16 and UTF-32 encoded files and
UTF-8-encoded files are strongly discouraged from having one[1] - (Use
of a BOM is neither required nor recommended for UTF-8) there are two
questions that arise IMO.
1. Does PHP support Files encoded in UTF16 or UTF-32? If so, we need to
handle the BOM somehow. If not, is that a requirement?
2. Wouldn't it be an easier approach to have a userland-lib that scans
files for a BOM and raises a warning? Like have an add-on to
php-cs-fixer or something like that? Especially the UTF-8 BOM
(\xEF\xBB\xBF) right at the start of a file would be easily to spot.
Just my 0.02€
Cheers
Andreas
[1] www.unicode.org/versions/Unicode5.0.0/ch02.pdf#page=30, Am 31.05.16
um 05:52 schrieb Sara Golemon
--
,,,
(o o)
+---------------------------------------------------------ooO-(_)-Ooo-+
| Andreas Heigl |
| mailto:andreas@heigl.org N
50°22'59.5" E 08°23'58" |
| http://andreas.heigl.org http://hei.gl/wiFKy7 |
+---------------------------------------------------------------------+
| http://hei.gl/root-ca
|
+---------------------------------------------------------------------+
Attachment: [application/pkcs7-signature] S/MIME Cryptographic Signature smime.p7s
Attachment: [application/pkcs7-signature] S/MIME Cryptographic Signature smime.p7s