From: Moriyoshi Koizumi Date: Mon, 2 Feb 2009 04:54:11 +0000 (+0000) Subject: - MFH: Fix bug #46843 (CP936 euro symbol is not converted properly) X-Git-Tag: php-5.2.9RC1~9 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=90d7d1004c22e6942c1a30f11be65ad25e40d389;p=php - MFH: Fix bug #46843 (CP936 euro symbol is not converted properly) --- diff --git a/NEWS b/NEWS index 1e97ad3828..ff91db4c6a 100644 --- a/NEWS +++ b/NEWS @@ -50,6 +50,7 @@ PHP NEWS - Fixed bug #46887 (Invalid calls to php_error_docref()). (oeriksson at mandriva dot com, Ilia) - Fixed bug #46873 (extract($foo) crashes if $foo['foo'] exists). (Arnaud) +- Fixed bug #46843 (CP936 euro symbol is not converted properly). (Moriyoshi) - Fixed bug #46798 (Crash in mssql extension when retrieving a NULL value inside a binary or image column type). (Ilia) - Fixed bug #46782 (fastcgi.c parse error). (Matt) diff --git a/ext/mbstring/libmbfl/filters/mbfilter_cp936.c b/ext/mbstring/libmbfl/filters/mbfilter_cp936.c index 9cdd0520e8..561dc3003b 100644 --- a/ext/mbstring/libmbfl/filters/mbfilter_cp936.c +++ b/ext/mbstring/libmbfl/filters/mbfilter_cp936.c @@ -192,7 +192,7 @@ mbfl_filt_conv_wchar_cp936(int c, mbfl_convert_filter *filter) } } if (s >= 0) { - if (s < 0x80) { /* latin */ + if (s <= 0x80) { /* latin */ CK((*filter->output_function)(s, filter->data)); } else { CK((*filter->output_function)((s >> 8) & 0xff, filter->data)); diff --git a/ext/mbstring/tests/bug46843.phpt b/ext/mbstring/tests/bug46843.phpt new file mode 100644 index 0000000000..136195cfe0 --- /dev/null +++ b/ext/mbstring/tests/bug46843.phpt @@ -0,0 +1,12 @@ +--TEST-- +Bug #46843 (CP936 euro symbol is not converted properly) +--SKIPIF-- + +--FILE-- + +--EXPECT-- +string(4) "20ac" +string(2) "80"