[Scilab-Dev] PATCH for set/get environment variables

Yung-Jang Lee yjlee123 at gmail.com
Mon Jan 26 18:39:07 CET 2009


Allan, Sylvestre :

Behavior of native 'gettext' may not in usual way in Allan's testing
of Chinese-Windows. And this cause the failure of testing, I think.

Usually, string return from native 'gettext' is in system encoding
rather than UTF8.  But from tracing the problems Allan reported in
this thread, I find that if "Language for non-Unicode programs" of
"Advanced option" is not compatible  with the region selected with
"Regional option" of ""Regional and Language options" in control panel
Windows, return string of 'gettext' is in UTF8 instead of system
encoding.

To resolve this problem, we need cover two prototypes of 'gettext'

   case 1.   system_locale_string gettext(char *key)

                 and

   case 2.   UTF8_string gettext(char *key)

Case 1 is for most Windows environment and being handled by current
Scialb5.X implementation. Case 2 only occur for multilanguage
environment when user change the region with "Regional option"  but
not change the "Language for non-Unicode programs" of "Advanced
option".


If it is what I expected, current implementation still works for most
single language environment. Therefore , to test Scilab localization ,
it need single language environment for each language.

Case 2 is quite unusual. I suggest wait for next few releases to fix
it when additional information are gathered.

As to Sylvestre recent change of  about localization,

 http://gitweb.scilab.org/?p=scilab;a=commitdiff;h=7c4255abc485b557f610370ff0530b75b5cc5e6

It look fine and seems not  related with Allan's reports in this
thread. But from the comments you put on  file 'localizatioJava.h'

----------------------------------------localizatioJava.h-----------------------------------
/* This piece of code has been written because of the bug #4005
 * in version 5.0, we were using two localization system (native and
 * Java).
 * Now, only the native one is used.
 * However, for an unknown reason, gettext() is not working. Only
 * dgettext is */
#define scigettext(String1) dgettext(NAMELOCALIZATIONDOMAIN,String1)
-----------------------------------------------------------------------------

I would suggest you replace macros 'scigettext' with

#define scigettext(String1) localeToUTF(gettext(String1))

just like macros  _(String)  in localozation.h

---------------------------------------------------------------------------
#define _(String)  localeToUTF(gettext(String))/** for console message*/
--------------------------------------------------------------------------


Regards,

Yung-Jang Lee



More information about the dev mailing list