[Scilab-Dev] Test report of Chinese (or multibytes languages in general) locale mesages with Scilab 5-beta-1
Yung-Jang Lee
yjlee123 at gmail.com
Mon Jun 2 17:36:15 CEST 2008
Sylvestre,
Enclosed is my small patch for Java console to display chinese characters
and the result PNG screenshot.
The test in under Windows XP, with BIG5 encoding (Windows CodePage 950).
This test confirm that it need a locale to utf-8 convert before send string
to Java console for locale not compatible with UNICODE.
The patch contains following files
1. localization\src\c : localetoutf.h, localetoutf.c
provide functions
void localeToUTF(char** buffer) <--- doing locale to utf convert
openLocaleToUTFConverter(char *sysLocale,char *lang) <--- open or
close converter
This two functions calls functions from iconv library which is
contained in Scilab5 prerequreiment.
2. localization\src\c : setlanguage.c,
add a line to call openLocaleToUTFConverter ,
3. localization\src\c : getLocaleInfo_Windows.c,
modified return value of getLocaleUserInfo in lang_contry.codepage format
t,codepage information is used inside openLocaleToUTFConverter
4. console\src\cpp: consolePrint.c :
add a line to call localeToUTF
This is just a small patch to test locale to utf encoding concept, it need
further enhancement.
I have two questions. First , in my chinese Java console , the menu items
are disabled ( unlike your Linux case) is this a bug under Windows ?
Second, menu items are displayed in chinese under Linux but in english
under Windows, what make them different ?
YungLee
2008/5/30 Yung-Jang Lee <yjlee123 at gmail.com>:
> Sylvestre:
>
> Let me try. Give me a week.
>
> YungLee
>
> 2008/5/30 Sylvestre Ledru <sylvestre.ledru at inria.fr>:
>
>
>> > To solve this problem, we must decide locale setting in runtime and
>> > transform characters back to UTF8 if the locale setting is not
>> > in UTF8.
>> OK, then, a way of doing this could be:
>> * if the LANG/LC_MESSAGES/whatever variable says that the language is
>> UTF-8, don't do anything.
>> * if not, convert it
>> However, that sounds like a workaround to me, not a really bug fix.
>> There must be a way to deal with this.
>>
>> > Hope these can help.
>> It does!
>>
>> S
>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/dev/attachments/20080602/65dd818b/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ScilabWinJava.png
Type: image/png
Size: 14929 bytes
Desc: not available
URL: <https://lists.scilab.org/pipermail/dev/attachments/20080602/65dd818b/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: chinesePatch.rar
Type: application/rar
Size: 10292 bytes
Desc: not available
URL: <https://lists.scilab.org/pipermail/dev/attachments/20080602/65dd818b/attachment.bin>
More information about the dev
mailing list