Re: Deprecate declare(encoding='...') + zend.multibyte + zend.script_encoding + zend.detect_unicode ?
| From: | youkidearitai | Date: | Tue, 28 Nov 2023 23:46:43 +0000 |
| Subject: | Re: Deprecate declare(encoding='...') + zend.multibyte + zend.script_encoding + zend.detect_unicode ? | ||
| References: | 1 2 3 4 5 6 7 8 9 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-121837@lists.php.net to get a copy of this message | ||
2023年11月29日(水) 8:07 Hans Henrik Bergan <divinity76@gmail.com>:
>
> @youkidearitai right now the code specifically deals with
> - UTF8: removing UTF8 BOM and removing `declare(encoding='UTF-8');
> - UTF16LE/UTF16BE/UTF32LE/UTF32BE: converting to UTF8 removing the BOM
> and removing declare(encoding='...')
> - ISO-8859-1: converting to UTF-8 and removing
> declare(encoding='ISO-8859-1'), i couldn't really find information on
> a ISO-8859-1 BOM, so to the best of my knowledge it does not exist
>
> it does not deal with any other encodings as of writing, but more can
> be added if needed.
>
Hi, Hans
I see. I understand the argument.
At least, Japanese character encoding seems not using declare(encoding=....).
Probably, we use zend_encoding implicitly.
If delete zend_encoding, In SJIS (Shift_JIS) probably will occur 5c problem..
For example is below:
$val = "表"; // 表 is 0x955c, script see 0x5c22, therefore, Throw on Parse Error
Please see about 5c problem https://blog.kano.ac/archive/posts/1654_5c-problem/
I would like to maintain backwards compatibility. zend_encoding seems
can't delete.
Regards
Yuya
--
---------------------------
Yuya Hamada (tekimen)
- https://tekitoh-memdhoi.info
- https://github.com/youkidearitai
-----------------------------