[xorg-bugzilla-noise] [Bug 1024] New: Japanese ctext conversion bug

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Tue Aug 10 03:51:43 PDT 2004


Please do not reply to this email: if you want to comment on the bug, go to          
the URL shown below and enter yourcomments there.   
 
https://freedesktop.org/bugzilla/show_bug.cgi?id=1024        
   
           Summary: Japanese ctext conversion bug
           Product: xorg
           Version: CVS_head
          Platform: PC
        OS/Version: Windows 2000
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Lib/Xlib
        AssignedTo: xorg-bugzilla-noise at freedesktop.org
        ReportedBy: ago at freedesktop.org


from http://freedesktop.org/pipermail/xorg/2004-August/002027.html

Compound Text Encoding say below 
> Once a GL or GR set has been defined, all further octets in that range (except
within control sequences and
> extended segments) are interpreted with respect to that character set
encoding, until the GL or GR set is
> redefined. GL and GR sets can be defined independently, they do not have to be
defined in pairs.

But in sjis_cttombs, sjis_ctstowcs, euc_ctstowcs and euc_ctstombs,
once GL or GR set is defined, the other set becomes undefined.
Ctext.patch will fix this. (Toshio Takabe)

> Note that when actually using a character set encoding as the GR set, you must
force the most significant
> bit (08/00) of each octet to be a one, so that it falls in the range 10/00 to
15/15.

sjis.patch fixs the problem that sjis_mbstocts doesn't set the most
significant bit to be a one. (Kensuke Matsuzaki)


If you need document about compound text, it is in xc/doc/*/CTEXT/.

I attached a test program. This program converts multi-byte text to
compound text, and re-converts compound text to multi-byte text.

compile
$ gcc -DX_LOCALE cnvtest.c -L /usr/X11R6/lib/ -lX11  -o cnvtest

and run. Input text and output text must be same. But
====
$ ./cnvtest.exe
from:0x82 0xa0 0x82 0xa2 0x82 0xa4 0x61 0x62 0x63 0x82 0xa0 0x82 0xa2 0x82 0xa4

¤¢¤¤¤¦abc¤¢¤¤¤¦
XmbTextListToTextProperty: 0
COMPOUND_TEXT
CompoundText:0x1b 0x24 0x29 0x42 0x24 0x22 0x24 0x24 0x24 0x26 0x61 0x62 0x63 0x
24 0x22 0x24 0x24 0x24 0x26 .
Segmentation fault (core dumped)


After appling patch
====
$ ./cnvtest.exe
from:0x82 0xa0 0x82 0xa2 0x82 0xa4 0x61 0x62 0x63 0x82 0xa0 0x82 0xa2 0x82 0xa4

¤¢¤¤¤¦abc¤¢¤¤¤¦
XmbTextListToTextProperty: 0
COMPOUND_TEXT
CompoundText:0x1b 0x24 0x29 0x42 0xa4 0xa2 0xa4 0xa4 0xa4 0xa6 0x61 0x62 0x63 0x
a4 0xa2 0xa4 0xa4 0xa4 0xa6
XmbTextPropertyToTextList: 0
1
to:0x82 0xa0 0x82 0xa2 0x82 0xa4 0x61 0x62 0x63 0x82 0xa0 0x82 0xa2 0x82 0xa4
¤¢¤¤¤¦abc¤¢¤¤¤¦        
   
   
--         
Configure bugmail: https://freedesktop.org/bugzilla/userprefs.cgi?tab=email       
   
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.


More information about the xorg-bugzilla-noise mailing list