[php-langspec][PR #234] - Define encoding of PHP scripts (Fix #233)

[email protected] Fri, 15 Mar 2019 09:05:37 +0000
Newsgroups php.standards
Message-ID <[email protected]>
You can view the Pull Request on github:
https://github.com/php/php-langspec/pull/234

Comment by nikic:
Sorry for the delay, I've merged this as https://github.com/php/php-langspec/commit/f35bd70531c012544e9061731415be8dcfe77f32 now.

I don't think this is entirely correct, but at least it's more correct than what we have now. Especially the statement that PHP scripts are ASCII encoded is not quite right. As I mentioned before, the technical requirement is that the encoding be ASCII-compatible, which is a term with a specific meaning: Unicode codepoints U+0000 to U+007F are encoded as bytes 0x00 through 0x7F, and bytes 0x00 through 0x7F do not appear as part of the encoding of any other codepoints.

This includes both UTF-8 and your example of ISO-8859-2. And it does make sense to talk about Unicode codepoints in the context of ISO-8859-2 -- while, this encoding cannot represent *all* Unicode codepoints, each character it represents also has an assigned Unicode codepoint. This is specified in auxiliary character set mapping tables published by the Unicode consortium, see ftp://ftp.unicode.org/Public/MAPPINGS/ISO8859/8859-2.TXT for this particular case.