Test report of Chinese (or multibytes languages in general) locale mesages with Scilab 5-beta-1

Yung-Jang Lee yjlee123 at gmail.com
Fri May 9 20:03:09 CEST 2008


Hi, everybody :

I am just beginning to  translate message PO files (in Scilab 5-beta-1) into
Chinese language (zh_TW),  and hope that will meet the next release schedule
of Scilab 5.

To test my translation (only few PO file right now), I generated scilab.mo
and scilab.po files in loclate\zh_TW\LC_MESSAGES with  script
generatePoFile in directory  toos\localization after setting language to
'zh_TW'.

The attached files are screehshots  after startup  of Scilab  showing banner
lines of my Chinese messages by   scilex.exe and Wscilex.exe respectively in
Windows-XP.

The first screehshot (scilexChinese.png generated by scilex.exe ) correctly
displays Chinese characters , while the second  one (wscilexChinese.png by
Wscilex.exe) fails.

My Windows-XP locale setting is zh_TW.BIG5 , while  messages  in core.po
file  are in UTF-8 encoding.

It appears to me that  Windows  will transform messages back to  its default
encoding (in my case, BIG5) and DOS console (scilex) handle this correctly.
But Java console expect an UTF-8  messages and the  received  BIG5 encoding
messages cause its failure in showing Chinese banner lines.

I think this is not a specific problem associate with Chinese language, any
multibytes language with  locale setting not in UTF-8  will probable  fail
in the same way.

I try to trace the source codes of Java console module to find a way to
attack this problem.  Transform messages back to UTF-8 in ConsolePrint.cpp (
module console) may help , for example :

int ConsolePrintf(char *line)
{
  lineUtf8=localeToUtf8(line); // <------ transform back to utf8
  CallScilabBridge::display(getScilabJavaVM(), line);
  return 0;
}

In this way, we need a function 'localeToUtf8'  which transform output
strings from locale to UTF-8 encoding. This function is provided in Glib and
may be implemented form iconv API within current Scialb developement
environment.

Hope my test can help and looking forward for suggestions or instructions to
attack this problems.

Best regards,

YungLee
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/dev/attachments/20080510/d3fdedf5/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: scilexChinese.png
Type: image/png
Size: 9248 bytes
Desc: not available
URL: <https://lists.scilab.org/pipermail/dev/attachments/20080510/d3fdedf5/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: wscilexChinese.png
Type: image/png
Size: 10589 bytes
Desc: not available
URL: <https://lists.scilab.org/pipermail/dev/attachments/20080510/d3fdedf5/attachment-0001.png>


More information about the dev mailing list