diff options
| author | Xinchen Hui <laruence@php.net> | 2011-11-18 08:50:29 +0000 |
|---|---|---|
| committer | Xinchen Hui <laruence@php.net> | 2011-11-18 08:50:29 +0000 |
| commit | 601407aa25712a47ae4d59e2046d822fe93eb501 (patch) | |
| tree | a6bf52296a23a09b57937927d4398163c500fb2c | |
| parent | 9a69efb9fc302c5e4c672f27a2f7c558db80152a (diff) | |
| download | php-git-601407aa25712a47ae4d59e2046d822fe93eb501.tar.gz | |
Fixed bug #60306 (Characters lost while converting from cp936 to utf8)
| -rw-r--r-- | ext/mbstring/libmbfl/filters/mbfilter_cp936.c | 4 | ||||
| -rw-r--r-- | ext/mbstring/tests/bug60306.phpt | 11 |
2 files changed, 12 insertions, 3 deletions
diff --git a/ext/mbstring/libmbfl/filters/mbfilter_cp936.c b/ext/mbstring/libmbfl/filters/mbfilter_cp936.c index a3baeabdfc..caf26e329b 100644 --- a/ext/mbstring/libmbfl/filters/mbfilter_cp936.c +++ b/ext/mbstring/libmbfl/filters/mbfilter_cp936.c @@ -103,7 +103,7 @@ int mbfl_filt_conv_cp936_wchar(int c, mbfl_convert_filter *filter) { int k; - int c1, c2, w; + int c1, c2, w = -1; switch (filter->status) { case 0: @@ -304,5 +304,3 @@ static int mbfl_filt_ident_cp936(int c, mbfl_identify_filter *filter) return c; } - - diff --git a/ext/mbstring/tests/bug60306.phpt b/ext/mbstring/tests/bug60306.phpt new file mode 100644 index 0000000000..f7969e1952 --- /dev/null +++ b/ext/mbstring/tests/bug60306.phpt @@ -0,0 +1,11 @@ +--TEST-- +Bug #60306 (Characters lost while converting from cp936 to utf8) +--SKIPIF-- +<?php extension_loaded('mbstring') or die('skip mbstring not available'); ?> +--FILE-- +<?php +$s = "洪仁玕"; +var_dump($s === mb_convert_encoding(mb_convert_encoding($s, "cp936", "utf8"), "utf8", "cp936")); +?> +--EXPECT-- +bool(true) |
