summaryrefslogtreecommitdiff
path: root/iconvdata/gbk.c
diff options
context:
space:
mode:
Diffstat (limited to 'iconvdata/gbk.c')
-rw-r--r--iconvdata/gbk.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/iconvdata/gbk.c b/iconvdata/gbk.c
index fc32a506d2..9215e0fd53 100644
--- a/iconvdata/gbk.c
+++ b/iconvdata/gbk.c
@@ -1,5 +1,5 @@
/* Mapping tables for GBK handling.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Sean Chen <sean.chen@turbolinux.com>, 1999.
@@ -13148,8 +13148,17 @@ static const char __gbk_from_ucs4_tab12[][2] =
if (__builtin_expect (ch <= 0x80, 0) \
|| __builtin_expect (ch > 0xfe, 0)) \
{ \
- /* This is illegal. */ \
- STANDARD_FROM_LOOP_ERR_HANDLER (1); \
+ if (__glibc_likely (ch == 0x80)) \
+ { \
+ /* Exception for the Euro sign (see CP936). */ \
+ ch = 0x20ac; \
+ ++inptr; \
+ } \
+ else \
+ { \
+ /* This is illegal. */ \
+ STANDARD_FROM_LOOP_ERR_HANDLER (1); \
+ } \
} \
else \
{ \
@@ -13292,6 +13301,10 @@ static const char __gbk_from_ucs4_tab12[][2] =
case 0x2010 ... 0x203b: \
cp = __gbk_from_ucs4_tab4[ch - 0x2010]; \
break; \
+ case 0x20ac: \
+ /* Exception for the Euro sign (see CP396). */ \
+ cp = "\x80"; \
+ break; \
case 0x2103 ... 0x22bf: \
cp = __gbk_from_ucs4_tab5[ch - 0x2103]; \
break; \