Commit: 7da331501545c36088b535be0c53580a268ee5f4 Author: Rui Hirokawa <hirok...@php.net> Wed, 31 Jul 2013 08:18:39 +0900 Parents: c10d7e1afc63f0a0eaadb115560cc3ca626eb245 Branches: PHP-5.5
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=7da331501545c36088b535be0c53580a268ee5f4 Log: added test script for bug65045. Bugs: https://bugs.php.net/65045 Changed paths: A ext/mbstring/tests/bug65045.phpt Diff: diff --git a/ext/mbstring/tests/bug65045.phpt b/ext/mbstring/tests/bug65045.phpt new file mode 100644 index 0000000..03a090d --- /dev/null +++ b/ext/mbstring/tests/bug65045.phpt @@ -0,0 +1,29 @@ +--TEST-- +Bug #65045: mb_convert_encoding breaks well-formed character +--SKIPIF-- +<?php extension_loaded('mbstring') or die('skip mbstring not available'); ?> +--FILE-- +<?php + +//declare(encoding = 'UTF-8'); +mb_internal_encoding('UTF-8'); + +$str = "\xF0\xA4\xAD". "\xF0\xA4\xAD\xA2"."\xF0\xA4\xAD\xA2"; +$expected = "\xEF\xBF\xBD"."\xF0\xA4\xAD\xA2"."\xF0\xA4\xAD\xA2"; + +$str2 = "\xF0\xA4\xAD\xA2"."\xF0\xA4\xAD\xA2"."\xF0\xA4\xAD"; +$expected2 = "\xF0\xA4\xAD\xA2"."\xF0\xA4\xAD\xA2"."\xEF\xBF\xBD"; + +mb_substitute_character(0xFFFD); +var_dump( + $expected === htmlspecialchars_decode(htmlspecialchars($str, ENT_SUBSTITUTE, 'UTF-8')), + $expected2 === htmlspecialchars_decode(htmlspecialchars($str2, ENT_SUBSTITUTE, 'UTF-8')), + $expected === mb_convert_encoding($str, 'UTF-8', 'UTF-8'), + $expected2 === mb_convert_encoding($str2, 'UTF-8', 'UTF-8') +); + +--EXPECT-- +bool(true) +bool(true) +bool(true) +bool(true) \ No newline at end of file -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php