summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/mbstring/mbfilter.c6
-rw-r--r--ext/mbstring/unicode_table.h8
2 files changed, 7 insertions, 7 deletions
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
};