]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
(ucs4_to_gb2312): Fix mapping of 0x0101, 0x2312, and 0x2500..0x254b.
authorUlrich Drepper <drepper@redhat.com>
Tue, 28 Dec 1999 04:55:10 +0000 (04:55 +0000)
committerUlrich Drepper <drepper@redhat.com>
Tue, 28 Dec 1999 04:55:10 +0000 (04:55 +0000)
iconvdata/gb2312.h

index cde9375e84c6f17cda32a7c9b28af6d7f2f8c395..330d5e9b2a412dfeff1fb7a4f3897fb0611c55c1 100644 (file)
@@ -1,5 +1,5 @@
 /* Access functions for GB2312 conversion.
-   Copyright (C) 1998 Free Software Foundation, Inc.
+   Copyright (C) 1998, 1999 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
 
@@ -75,7 +75,7 @@ ucs4_to_gb2312 (uint32_t wch, unsigned char *s, size_t avail)
 
   switch (ch)
     {
-    case 0xa4 ... 0x100:
+    case 0xa4 ... 0x101:
       cp = __gb2312_from_ucs4_tab1[ch - 0xa4];
       break;
     case 0x113:
@@ -135,7 +135,7 @@ ucs4_to_gb2312 (uint32_t wch, unsigned char *s, size_t avail)
     case 0x2103 ... 0x22a5:
       cp = __gb2312_from_ucs4_tab5[ch - 0x2103];
       break;
-    case 0x2313:
+    case 0x2312:
       cp = "\x21\x50";
       break;
     case 0x2460 ... 0x249b:
@@ -143,7 +143,7 @@ ucs4_to_gb2312 (uint32_t wch, unsigned char *s, size_t avail)
       break;
     case 0x2500 ... 0x254b:
       buf[0] = '\x29';
-      buf[1] = '\x24' + (ch & 256);
+      buf[1] = '\x24' + (ch % 256);
       break;
     case 0x25a0:
       cp = "\x21\x76";