mirror of
https://github.com/php/php-src.git
synced 2026-03-31 12:42:29 +02:00
Previously, mbstring would accept a lot of things which were not valid UHC text. No more. - Don't allow single-byte control characters to appear where the 2nd byte of a multi-byte character should be. - Validate that the 2nd byte of a multi-byte character is in the expected range. - Treat it as an error if a multi-byte character is truncated. Also add a test suite to confirm that UHC conversion (both to and from Unicode) works according to spec.
17 lines
354 B
PHP
17 lines
354 B
PHP
--TEST--
|
|
Exhaustive test of verification and conversion of CP949 (UHC) text
|
|
--EXTENSIONS--
|
|
mbstring
|
|
--SKIPIF--
|
|
<?php
|
|
if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
|
|
?>
|
|
--FILE--
|
|
<?php
|
|
include('encoding_tests.inc');
|
|
testEncodingFromUTF16ConversionTable(__DIR__ . '/data/CP949.txt', 'UHC');
|
|
?>
|
|
--EXPECT--
|
|
Tested UHC -> UTF-16BE
|
|
Tested UTF-16BE -> UHC
|