diff options
| author | Moriyoshi Koizumi <moriyoshi@php.net> | 2009-02-02 04:53:10 +0000 |
|---|---|---|
| committer | Moriyoshi Koizumi <moriyoshi@php.net> | 2009-02-02 04:53:10 +0000 |
| commit | aba813266ad7bcf7ee0d70fb97c2ca49c9c70de6 (patch) | |
| tree | 7bc4e921685d6bd87db659da0e6143d2e0291a7c | |
| parent | ab0eff9a14f92400163f8632b75d33ee92138218 (diff) | |
| download | php-git-aba813266ad7bcf7ee0d70fb97c2ca49c9c70de6.tar.gz | |
- MFH: Fix bug #46843 (CP936 euro symbol is not converted properly)
| -rw-r--r-- | ext/mbstring/libmbfl/filters/mbfilter_cp936.c | 2 | ||||
| -rw-r--r-- | ext/mbstring/tests/bug46843.phpt | 12 |
2 files changed, 13 insertions, 1 deletions
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-- +<?php extension_loaded('mbstring') or die('skip mbstring not available'); ?> +--FILE-- +<?php +var_dump(bin2hex(mb_convert_encoding("\x80", 'UCS-2BE', 'CP936'))); +var_dump(bin2hex(mb_convert_encoding("\x20\xac", 'CP936', 'UCS-2BE'))); +?> +--EXPECT-- +string(4) "20ac" +string(2) "80" |
