about summary refs log tree commit diff
path: root/iconvdata/gbk.c
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2016-11-29 18:35:12 +0100
committerFlorian Weimer <fweimer@redhat.com>2016-11-29 18:35:21 +0100
commit0415d32187731ac03ef6c72c6cfb25314d4b0133 (patch)
tree2e0bdf21895f5153074b380f6b5c141a76d2059f /iconvdata/gbk.c
parenta09411756fd935482a81e99dc3f3eae99843d012 (diff)
downloadglibc-0415d32187731ac03ef6c72c6cfb25314d4b0133.tar.gz
glibc-0415d32187731ac03ef6c72c6cfb25314d4b0133.tar.xz
glibc-0415d32187731ac03ef6c72c6cfb25314d4b0133.zip
gconv: Adjust GBK to support the Euro sign
Commit aa4d00ca39e604ac4e9fead401ccd4483e11a281 only updated the
data used by locales.
Diffstat (limited to 'iconvdata/gbk.c')
-rw-r--r--iconvdata/gbk.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/iconvdata/gbk.c b/iconvdata/gbk.c
index fc32a506d2..8e12e95ff3 100644
--- a/iconvdata/gbk.c
+++ b/iconvdata/gbk.c
@@ -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;							      \