]> granicus.if.org Git - php/commitdiff
bug fixed in unicode -> cp1252 table.
authorRui Hirokawa <hirokawa@php.net>
Sun, 5 May 2002 11:42:18 +0000 (11:42 +0000)
committerRui Hirokawa <hirokawa@php.net>
Sun, 5 May 2002 11:42:18 +0000 (11:42 +0000)
ext/mbstring/mbfilter.c
ext/mbstring/unicode_table.h

index 4577311c749af45e59710b8a04aa9dcb7a4fdfaf..3e065fa4538654e267a2fec657f1cbc3f96488d1 100644 (file)
@@ -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;
                        }
index 7b699ea10a43e4af87802e3021e1ccdfa1959dca..884e6e37aeabdf3cdceff27adca67782ce1be434 100644 (file)
  * 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
 };