[php-src] Issue #8308: The return value of mb_list_encodings() doesn't contain 'SJIS-win'
| From: | sj-i | Date: | Sat, 09 Apr 2022 19:09:50 +0000 |
| Subject: | [php-src] Issue #8308: The return value of mb_list_encodings() doesn't contain 'SJIS-win' | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-240820@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/8308
Comment Author: sj-i
About U+203E, there should be another background...
Your finding of the WHATWG encoding standard would be a hint.
https://encoding.spec.whatwg.org/#shift_jis
https://github.com/whatwg/encoding/commit/be441c878334cba53ee0be6d6640deb572605ee2
This was added in 2012. But W3C and WHATWG are standardization organizations, there must be at least
one, probably two actual implementations that behave like this beforehand.
I'm currently searching for old implementations of browsers that handle encodings.
BTW, glibc iconv translates U+203E to 0x7E on converting Unicode texts to CP932.
https://gist.github.com/sj-i/c003796281253c41b70a1d9b92de2ea3
http://www2d.biglobe.ne.jp/~msyk/cgi-bin/charcode/373.html
Maybe this is the reason of the glibc implementation.
glibc iconv adopts a UCS normalization, so even conversions between SJIS family and EUC-JP family
are done through Unicode.
So additional one-way mappings are required for each encoding for convenience.
I assume a similar reason is there for browser implementations.