mirror of
https://github.com/php/php-src.git
synced 2024-10-01 06:46:08 +00:00
e2d4d700cf
The three assignments above this line are still broken - they assume that byte offsets in one encoding directly map to byte offsets in another encoding. I'm fixing the length here because it is the one causing out-of-bounds reads and is easy to fix. For the others we'd have to actually compute new offsets.
18 lines
463 B
PHP
18 lines
463 B
PHP
--TEST--
|
|
zend multibyte (9)
|
|
--INI--
|
|
error_reporting=E_ALL & ~E_DEPRECATED
|
|
zend.multibyte=On
|
|
zend.script_encoding=cp1251
|
|
mbstring.internal_encoding=UTF-8
|
|
--FILE--
|
|
<?php
|
|
declare(encoding="EUC-JP");
|
|
// forcefully interpret an UTF-8 encoded string as EUC-JP and then convert it
|
|
// back to UTF-8. There should be only a pair of consecutive bytes that is
|
|
// valid EUC-encoded character "鴻".
|
|
var_dump(bin2hex("テスト"));
|
|
?>
|
|
--EXPECT--
|
|
string(16) "3f3f3fe9b4bb3f3f"
|