From: Rui Hirokawa Date: Sun, 5 May 2002 11:42:18 +0000 (+0000) Subject: bug fixed in unicode -> cp1252 table. X-Git-Tag: php-4.3.0dev-ZendEngine2-Preview1~223 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b7321edb842eea687cfea08c987b84884ee74699;p=php bug fixed in unicode -> cp1252 table. --- diff --git a/ext/mbstring/mbfilter.c b/ext/mbstring/mbfilter.c index 4577311c74..3e065fa453 100644 --- a/ext/mbstring/mbfilter.c +++ b/ext/mbstring/mbfilter.c @@ -1684,8 +1684,8 @@ static struct mbfl_convert_vtbl vtbl_cp1252_wchar = { mbfl_filt_conv_common_flush }; static struct mbfl_convert_vtbl vtbl_wchar_cp1252 = { - mbfl_no_encoding_cp1252, mbfl_no_encoding_wchar, + mbfl_no_encoding_cp1252, mbfl_filt_conv_common_ctor, mbfl_filt_conv_common_dtor, mbfl_filt_conv_wchar_cp1252, @@ -4537,9 +4537,9 @@ mbfl_filt_conv_wchar_cp1252(int c, mbfl_convert_filter *filter TSRMLS_DC) if (c >= 0x100) { /* look it up from the cp1252 table */ s = -1; - n = 30; + n = 31; while (n >= 0) { - if (c == cp1252_ucs_table[n]) { + if (c == cp1252_ucs_table[n] && c != 0xfffe) { s = 0x80 + n; break; } diff --git a/ext/mbstring/unicode_table.h b/ext/mbstring/unicode_table.h index 7b699ea10a..884e6e37ae 100644 --- a/ext/mbstring/unicode_table.h +++ b/ext/mbstring/unicode_table.h @@ -16,10 +16,10 @@ * This table differs from the rest of the unicode tables below * as it only covers this range, while the rest cover 0xa0 onwards */ static const unsigned short cp1252_ucs_table[] = { - 0xfffe,0xfffe,0x201a,0x0192,0x201e,0x2026,0x2020,0x2021, - 0x02c6,0x2030,0x0160,0x2039,0x0152,0xfffe,0xfffe,0xfffe, - 0xfffe,0x2018,0x2019,0x201c,0x201d,0x2022,0x2013,0x02dc, - 0x2122,0x0161,0x203a,0x0153,0xfffe,0xfffe,0x0178 + 0x20ac,0xfffe,0x201a,0x0192,0x201e,0x2026,0x2020,0x2021, + 0x02c6,0x2030,0x0160,0x2039,0x0152,0xfffe,0x017d,0xfffe, + 0xfffe,0x2018,0x2019,0x201c,0x201d,0x2022,0x2013,0x2014, + 0x02dc,0x2122,0x0161,0x203a,0x0153,0xfffe,0x017e,0x0178 };