From aba813266ad7bcf7ee0d70fb97c2ca49c9c70de6 Mon Sep 17 00:00:00 2001 From: Moriyoshi Koizumi Date: Mon, 2 Feb 2009 04:53:10 +0000 Subject: [PATCH] - MFH: Fix bug #46843 (CP936 euro symbol is not converted properly) --- ext/mbstring/libmbfl/filters/mbfilter_cp936.c | 2 +- ext/mbstring/tests/bug46843.phpt | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 ext/mbstring/tests/bug46843.phpt 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" -- 2.50.1