This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Remove 0x005C conversion from __jisx0208_from_ucs4_lat1 for ISO-2022-JP


This patch removes 0x005C from __jisx0208_from_ucs4_lat1 table at
iconvdata/jis0208.c.  Without this patch, ISO-646 0x5c (reverse
solidus, backslash: (\)) in ISO-2022-JP is converted to 0x2140
(fullwidth reverse solidus: EUC-JP:0xa1c0, U+ff3c) when we convert it
into ISO-2022-JP(-1..-3) and 0x5c is appeared after JISX0208
character.  __jisx0208_from_ucs4_lat1 table is used by EUC-JP,
ISO-2022-JP, and ISO-2022-JP-3, but EUC-JP does not use this table
when the character is 0x5c, so it's ISO-2022-JP, -2 and ISO-2022-JP-3
specific issue.

To show the problem, try the following example.  It unexpectedly
converts 2nd '\' to FULLWIDTH REVERSE SOLIDUS.

	printf '\033$B\x24\x22\033(B\\a\\\n' | \
	iconv -f ISO-2022-JP -t ISO-2022-JP

Regards,
-- gotom


2004-08-13  GOTO Masanori  <gotom@debian.or.jp>

	* iconvdata/jis0208.c: Remove 0x005C mapping from
	__jisx0208_from_ucs4_lat1.
	Reported by Fumitoshi UKAI <ukai@debian.or.jp>


Index: iconvdata/jis0208.c
===================================================================
RCS file: /cvs/glibc/libc/iconvdata/jis0208.c,v
retrieving revision 1.7
diff -u -r1.7 jis0208.c
--- iconvdata/jis0208.c	17 Dec 2002 01:29:56 -0000	1.7
+++ iconvdata/jis0208.c	12 Aug 2004 16:44:14 -0000
@@ -1,5 +1,5 @@
 /* Mapping tables for JIS0208 handling.
-   Copyright (C) 1997, 1998, 2002 Free Software Foundation, Inc.
+   Copyright (C) 1997, 1998, 2002, 2004 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
 
@@ -1785,10 +1785,10 @@
 
 const char __jisx0208_from_ucs4_lat1[256][2] =
 {
-  [0x005C] = "\x21\x40", [0x00A2] = "\x21\x71", [0x00A3] = "\x21\x72",
-  [0x00A7] = "\x21\x78", [0x00A8] = "\x21\x2f", [0x00AC] = "\x22\x4c",
-  [0x00B0] = "\x21\x6B", [0x00B1] = "\x21\x5e", [0x00B4] = "\x21\x2d",
-  [0x00B6] = "\x22\x79", [0x00D7] = "\x21\x5f", [0x00F7] = "\x21\x60"
+  [0x00A2] = "\x21\x71", [0x00A3] = "\x21\x72", [0x00A7] = "\x21\x78",
+  [0x00A8] = "\x21\x2f", [0x00AC] = "\x22\x4c", [0x00B0] = "\x21\x6B",
+  [0x00B1] = "\x21\x5e", [0x00B4] = "\x21\x2d", [0x00B6] = "\x22\x79",
+  [0x00D7] = "\x21\x5f", [0x00F7] = "\x21\x60"
 };
 
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]