Is everybody OK with me checking this into the tree as well as applying it unofficially to the next revision of the 0.9.4.1 debian packages?
----- Forwarded message from Anthony Fok <[EMAIL PROTECTED]> ----- From: Anthony Fok <[EMAIL PROTECTED]> Date: Wed, 10 Oct 2001 10:18:38 +0800 To: [EMAIL PROTECTED] Subject: Bug#113610: AbiWord-0.9.4.1 CJK fix is available User-Agent: Mutt/1.3.22i Hello Aaron, Thanks to Chinese i18n/L10n guru Rigel (Yong LI), the CJK input problem is solved. I have tested it (locally built an abiword-0.9.4.1-3.1 package) and it worked. So, please apply the following patch, and you can close this bug. :-) Thanks, Anthony ----- Forwarded message from Yong LI <[EMAIL PROTECTED]> ----- Date: Sun, 07 Oct 2001 23:42:44 -0700 From: Yong LI <[EMAIL PROTECTED]> Subject: [Patch] Fix multibyte key string conversion problem in 0.9.4.1 To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Content-type: text/plain; charset=us-ascii; format=flowed In the method ev_UnixKeyboard::keyPressEvent, a "UT_Mbtowc" object is used to convert multibyte sequence to wchar. However the declaration of this "UT_Mbtowc" object is placed inside the conversion loop, which means for every byte to be converted a new "UT_Mbtowc" object is constructed. This effectively disables the conversion of multibyte-encoded characters which requires accumulation of multiple bytes. One visible consequence of this problem is that input for all CJK languages fail to work in 0.9.4.1. A patch is attached. regards, rigel diff -u abi.orig/src/af/ev/unix/ev_UnixKeyboard.cpp abi/src/af/ev/unix/ev_UnixKeyboard.cpp --- abi.orig/src/af/ev/unix/ev_UnixKeyboard.cpp Mon Sep 10 09:53:44 2001 +++ abi/src/af/ev/unix/ev_UnixKeyboard.cpp Sun Oct 7 15:04:38 2001 @@ -185,10 +185,10 @@ } else { + UT_Mbtowc m; ucs=new UT_UCSChar[mLength]; for(int i=0;i<mLength;++i) { - UT_Mbtowc m; wchar_t wc; if(m.mbtowc(wc,mbs[i])) ucs[uLength++]=wc; -- Anthony Fok Tung-Ling ThizLinux Laboratory <[EMAIL PROTECTED]> http://www.thizlinux.com/ Debian Chinese Project <[EMAIL PROTECTED]> http://www.debian.org/intl/zh/ Come visit Our Lady of Victory Camp! http://www.olvc.ab.ca/ ----- End forwarded message ----- -- #define m(i)(x[i]^s[i+84])<< /* I do not condone improper use of this code */ unsigned char x[5],y,s[2048];main(n){for(read(0,x,5);read(0,s,n=2048);write(1,s ,n))if(s[y=s[13]%8+20]/16%4==1){int i=m(1)17^256+m(0)8,k=m(2)0,j=m(4)17^m(3)9^k *2-k%8^8,a=0,c=26;for(s[y]-=16;--c;j*=2)a=a*2^i&1,i=i/2^j&1<<24;for(j=127;++j<n ;c=c>y)c+=y=i^i/8^i>>4^i>>12,i=i>>8^y<<17,a^=a>>14,y=a^a*8^a<<6,a=a>>8^y<<9,k=s [j],k="7Wo~'G_\216"[k&7]+2^"cr3sfw6v;*k+>/n."[k>>4]*2^k*257/8,s[j]=k^(k&k*2&34) *6^c+~y;}}//Please join us in civil disobedience and distribute DeCSS(or efdtt!)