From: <no...@so...> - 2002-05-22 00:34:20
|
Bugs item #557030, was opened at 2002-05-16 17:41 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=110894&aid=557030&group_id=10894 Category: 10. Objects Group: = 8.3.3 Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Jeffrey Hobbs (hobbs) Summary: Bug for the zh_CN locale Initial Comment: tcl crashes when LC_CTYPE is set to one of the zh_CN.GB* locales (e.g., zh_CN.GB2312). I encountered this problem with tcl 8.3.3 in both redhat-7.2 and redhat-7.3 distributions and I had to removed the file gb2312.enc in order to run tcl scripts (I don't need Chinese characters with tcl anyway). Linbo Zhang ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2002-05-21 17:34 Message: Logged In: NO Yes the startup problem can be solved by replacing gb2312.enc with a symbolic link to cp936.enc, and even Chinese characters can be correctly displayed with both tcl/tk 8.3 and 8.4. But Chinese input does not work (I was using xcin for Chinese input), maybe because tcl/tk does not support XIM? LB ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2002-05-20 23:51 Message: Logged In: NO No, the problem is not at GB2312 locale table, nor is it at the way tcl dealing with locales. It is (for historical reason) because most (if not all) of the GB2312 locales used in Chinese fonts are actually GBK(code page 936). That's why the patch I copied from www.linuxforum.net works here. Another quick fix is copy cp936.enc to gb2312.enc in tcl's encoding directory. Well, I don't know how 8.4 has improved on i18n, just hope these can be helpfull to you, again. Only ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2002-05-20 19:51 Message: Logged In: NO I have installed tcl/tk 8.4a4 (tcl was built with '--enable-langinfo' option, and I had to keep the files libtcl.so.0, libtk.so.0, and /usr/bin/wish, because many RH packages depend on them). It seems that the problem still exists. E.g., $ LC_CTYPE=zh_CN.GB2312 wish8.4 does not work. The problem may be in my GB2312 locale? ZLB ---------------------------------------------------------------------- Comment By: Jeffrey Hobbs (hobbs) Date: 2002-05-20 17:56 Message: Logged In: YES user_id=72656 It should be noted that 8.4 has enabled the use of nl_langinfo in the Unix startup. I believe this corrects this problem, but it was not backported to 8.3.x. If someone on a Chinese system could please test the 8.4 sources for correctness, that would help. ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2002-05-20 17:44 Message: Logged In: NO I tried the above patch with tcl-8.3.3-67 (RH7.3) and it seemed to solve the (startup) problem. Thanks. I may have misstated my problem in my first mail. The real problem was that TCL can't start up ("Tcl_Init failed: Can't find a usable init.tcl ...") with the zh_CN.GB* locales. Linbo diff -burN tcl8.3.3.orig/unix/tclUnixInit.c tcl8.3.3/unix/tclUnixInit.c --- tcl8.3.3.orig/unix/tclUnixInit.c Wed Apr 4 06:54:39 2001 +++ tcl8.3.3/unix/tclUnixInit.c Mon May 20 20:02:45 2002 @@ -56,6 +56,7 @@ } LocaleTable; static CONST LocaleTable localeTable[] = { + {"chinese", "cp936"}, {"ja_JP.SJIS", "shiftjis"}, {"ja_JP.EUC", "euc-jp"}, {"ja_JP.eucJP", "euc-jp"}, @@ -90,6 +91,20 @@ {"ru_SU", "iso8859-5"}, {"zh", "cp936"}, + {"zh_CN", "cp936"}, + {"zh_CN.GB2312", "cp936"}, + {"zh_CN.GBK", "cp936"}, + {"zh_CN.GB18030", "cp936"}, +#ifdef hpux + {"zh_CN.hp15CN", "cp936"}, +#endif + {"zh_CN.gb2312", "cp936"}, + {"zh_CN.gbk", "cp936"}, + {"zh_CN.gb18030", "cp936"}, + {"zh_HK", "cp950"}, + {"zh_TW", "cp950"}, + {"zh_TW.Big5", "cp950"}, + {"zh_TW.big5", "cp950"}, {NULL, NULL} }; ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2002-05-20 01:49 Message: Logged In: NO Hello, I saw this patch posted on www.linuxforum.net for this issue. Hope this will help. --- tcltk-8.3.2/tcl8.3.2/unix/tclUnixInit.c.locale Thu May 10 16:32:41 2001+++ tcltk-8.3.2/tcl8.3.2/unix/tclUnixInit.c Thu May 10 16:37:23 2001 @@ -56,6 +56,7 @@ } LocaleTable; static CONST LocaleTable localeTable[] = { + {"chinese", "cp936"}, {"ja_JP.SJIS", "shiftjis"}, {"ja_JP.EUC", "euc-jp"}, {"ja_JP.JIS", "iso2022-jp"}, @@ -89,6 +90,18 @@ {"ru_SU", "iso8859-5"}, {"zh", "cp936"}, + {"zh_CN", "cp936"}, + {"zh_CN.GBK", "cp936"}, + {"zh_CN.GB2312", "cp936"}, +#ifdef hpux + {"zh_CN.hp15CN", "cp936"}, +#endif + {"zh_CN.gbk", "cp936"}, + {"zh_CN.gb18030", "cp936"}, + {"zh_HK", "cp950"}, + {"zh_TW", "cp950"}, + {"zh_TW.Big5", "cp950"}, + {"zh_TW.big5", "cp950"}, {NULL, NULL} }; ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=110894&aid=557030&group_id=10894 |