mirror of
https://github.com/php/php-src.git
synced 2024-09-22 10:27:25 +00:00
added missing parentheses
added test case for bug #68846 replaced tab with space added missing parentheses again See also: http://icu-project.org/docs/papers/gb18030.html#h7
This commit is contained in:
parent
2f06413340
commit
9d81d7ff70
@ -239,7 +239,7 @@ mbfl_filt_conv_gb18030_wchar(int c, mbfl_convert_filter *filter)
|
||||
if (((c1 >= 0x81 && c1 <= 0x84) || (c1 >= 0x90 && c1 <= 0xe3)) &&
|
||||
c2 >= 0x30 && c2 <= 0x39 && c3 >= 0x81 && c3 <= 0xfe && c >= 0x30 && c <= 0x39) {
|
||||
if (c1 >= 0x90 && c1 <= 0xe3) {
|
||||
w = ((c1 - 0x90)*10 + (c2 - 0x30)*126 + (c3 - 0x81))*10 + (c - 0x30) + 0x10000;
|
||||
w = ((((c1 - 0x90)*10 + (c2 - 0x30))*126 + (c3 - 0x81)))*10 + (c - 0x30) + 0x10000;
|
||||
} else { /* Unicode BMP */
|
||||
w = (((c1 - 0x81)*10 + (c2 - 0x30))*126 + (c3 - 0x81))*10 + (c - 0x30);
|
||||
if (w >= 0 && w <= 39419) {
|
||||
|
12
ext/mbstring/tests/bug68846.phpt
Normal file
12
ext/mbstring/tests/bug68846.phpt
Normal file
@ -0,0 +1,12 @@
|
||||
--TEST--
|
||||
Bug #68846 False detection of CJK Unified Ideographs Extension E
|
||||
--SKIPIF--
|
||||
<?php extension_loaded('mbstring') or die('skip mbstring not available'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(
|
||||
"\x00\x02\x0b\xb7" === mb_convert_encoding("\x95\x34\xb2\x35", 'UTF-32', 'GB18030')
|
||||
);
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(true)
|
Loading…
Reference in New Issue
Block a user