NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

lib/39445: iconv returns wrong character on CP932



>Number:         39445
>Category:       lib
>Synopsis:       iconv returns wrong character on CP932
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    lib-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Sep 01 07:15:01 +0000 2008
>Originator:     NARUSE, Yui
>Release:        NetBSD 4.99.72
>Organization:
>Environment:
>Description:
Citrus iconv supports Microsoft CP932 (a.k.a. Windows-31J).
This codeset includes some duplicate mappings in Unicode to CP932 conversion.

Microsoft shows priority for those characters, but current NetBSD's 
implementation doesn't follow this.
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q170559

Specification says priority is JISX0208 > NEC > NEC_IBM > IBM,
but implementation is JISX0208 > NEC > IBM > NEC_IBM.
http://www2d.biglobe.ne.jp/~msyk/charcode/cp932/uni2sjis.html (in japanese)


>How-To-Repeat:
Microsoft shows:

  0xeeef   -> U+2170   -> 0xfa40   Small Roman Numeral One

NetBSD 4.99.72:

  % printf '\x21\x70'|iconv -f utf-16be -t cp932|hexdump -C
  00000000  ee ef  

>Fix:
This is because mapper.dir.CP.src specifies wrong priority.
Following is a patch.

Index: mapper.dir.CP.src
===================================================================
RCS file: /cvsroot/src/share/i18n/csmapper/CP/mapper.dir.CP.src,v
retrieving revision 1.9
diff -u -p -r1.9 mapper.dir.CP.src
--- mapper.dir.CP.src   3 Dec 2006 14:28:46 -0000       1.9
+++ mapper.dir.CP.src   1 Sep 2008 06:57:42 -0000
@@ -13,6 +13,6 @@ CP942/UCS             mapper_parallel CP932UDA/UCS,
 CP943/UCS              mapper_parallel 
JISX0208VDC:NEC/UCS,CP932VDC:NEC_IBM/UCS,CP932VDC:IBM/UCS,CP932UDA/UCS,JISX0208:1990/UCS
 UCS/CP50220            mapper_parallel 
UCS/JISX0208:MS,UCS/JISX0208VDC:NEC,UCS/CP932VDC:NEC_IBM,UCS/CP932UDA
 UCS/CP51932            mapper_parallel 
UCS/JISX0208:MS,UCS/JISX0208VDC:NEC,UCS/CP932VDC:NEC_IBM
-UCS/CP932KANJI         mapper_parallel 
UCS/JISX0208:MS,UCS/JISX0208VDC:NEC,UCS/CP932VDC:NEC_IBM,UCS/CP932VDC:IBM,UCS/CP932UDA
+UCS/CP932KANJI         mapper_parallel 
UCS/JISX0208:MS,UCS/JISX0208VDC:NEC,UCS/CP932VDC:IBM,UCS/CP932VDC:NEC_IBM,UCS/CP932UDA
 UCS/CP942              mapper_parallel UCS/CP942EXT,UCS/CP932UDA
 UCS/CP943              mapper_parallel 
UCS/JISX0208:1990,UCS/JISX0208VDC:NEC,UCS/CP932VDC:NEC_IBM,UCS/CP932VDC:IBM,UCS/CP932UDA



Home | Main Index | Thread Index | Old Index