From: Tatsuro M. <tma...@ya...> - 2021-12-16 22:57:17
|
Ethan Thank you for your detailed explanation. I surely have misunderstood the situation. > So I think that to change the initial encoding in gnuplot, the user needs to either > (1) set an appropriate environmental variable global to the session or > (2) set the code page to CP65001. > > Is there a good place to find instructions on how to do this? > Should we add a section to the installation instructions or the user manual? Behavior cp65001 of current windows 10 is changed before. past :Japanese font cannot be selected .IME input of Japanese characters is impossible now : Japanese font can be selected. IME input Japanese characters is possible. I do not know when the above change ocurr. I think that the user manual is appropriate. Tatsuro > ----- Original Message ----- > > > On Thursday, 16 December 2021 11:50:25 PST Tatsuro MATSUOKA wrote: > > We consider the case where there is no "set encoding xxxx" in GNUPLOT.INT and GNUTERM is not specified. > > At start up, excution result of "show encoding" > > Cygwin => default (Perhaps on Linux the same) > > Windows (on Japanese env.) => sjis (ShiftJIS, old Japanese encording) > > Windows (not Japanese env.) => I do not know > > > > Now even on Windows standard text editor notepad.exe, default encoding is utf8 but not sjis. > > Sjis encording is only for backward compatibility. > > Are you sure this is set by the program and not by the system or user preferences? > > > sjis being default encoding on windows on Japanese env. is better to be stopped. > > So far as I know gnuplot would only start with encoding SJIS if the user's computer > has current locale set to use sjis. > > Gnuplot's initialization is done in routine encoding_from_locale() in file encoding.c. > > It first tries to use the system function > l = setlocale(LC_CTYPE, ""); > > The man page says > If locale is an empty string, "", each part of the locale that should be modified is > set according to the environment variables. The details are implementation-dependent. > For glibc, first (regardless of category), the environment variable LC_ALL is in‐ > spected, next the environment variable with the same name as the category (see the ta‐ > ble above), and finally the environment variable LANG. The first existing environment > variable is used. If its value is not a valid locale specification, the locale is un‐ > changed, and setlocale() returns NULL. > > On linux an appropriate japanese locale string is "ja_JP.UTF-8" > but I know that Windows uses different names for locales. > > Do you know if your Japanese env. machine is returning a valid locale specification at this > point? If so, that is what gnuplot will use. If no valid return is detected, the program > then falls through to this code: > #ifdef _WIN32 > /* get encoding from currently active codepage */ > if (encoding == S_ENC_INVALID) { > #ifndef WGP_CONSOLE > encoding = map_codepage_to_encoding(GetACP()); > #else > encoding = map_codepage_to_encoding(GetConsoleCP()); > #endif > } > #endif > > So I think that to change the initial encoding in gnuplot, the user needs to either > (1) set an appropriate environmental variable global to the session or > (2) set the code page to CP65001. > > Is there a good place to find instructions on how to do this? > Should we add a section to the installation instructions or the user manual? > > > > > > > |
From: Bastian M. <bma...@we...> - 2021-12-17 08:29:29
|
Please note that setting the default process code page to UTF-8 is a new (beta) feature (1903) which might not be supported by LTS installations yet (mine doesn't). (Setting an environment variable won't do the trick though). Changing the default for gnuplot is as easy as adding "set encoding utf8" to "gnuplot.ini". We could add an option to the installer to make utf8 the default instead of the "ANSI" codepage, though, similar to the selection of the default terminal. Bastian > -----Ursprüngliche Nachricht----- > Von: Tatsuro MATSUOKA <tma...@ya...> > Gesendet: Donnerstag, 16. Dezember 2021 23:57 > An: eam...@gm...; beta <gnu...@li...> > Betreff: Re: Re: default encoding on Japanese windows environment > > Ethan > > Thank you for your detailed explanation. > I surely have misunderstood the situation. > > > So I think that to change the initial encoding in gnuplot, the user > > needs to either > > (1) set an appropriate environmental variable global to the session or > > (2) set the code page to CP65001. > > > > Is there a good place to find instructions on how to do this? > > Should we add a section to the installation instructions or the user manual? > > Behavior cp65001 of current windows 10 is changed before. > past :Japanese font cannot be selected .IME input of Japanese characters is > impossible > now : Japanese font can be selected. IME input Japanese characters is > possible. > I do not know when the above change ocurr. > > I think that the user manual is appropriate. > > Tatsuro > > > ----- Original Message ----- > > > > > > On Thursday, 16 December 2021 11:50:25 PST Tatsuro MATSUOKA wrote: > > > We consider the case where there is no "set encoding xxxx" in > GNUPLOT.INT and GNUTERM is not specified. > > > At start up, excution result of "show encoding" > > > Cygwin => default (Perhaps on Linux the same) Windows (on Japanese > > > env.) => sjis (ShiftJIS, old Japanese encording) Windows (not > > > Japanese env.) => I do not know > > > > > > Now even on Windows standard text editor notepad.exe, default encoding > is utf8 but not sjis. > > > Sjis encording is only for backward compatibility. > > > > Are you sure this is set by the program and not by the system or user > preferences? > > > > > sjis being default encoding on windows on Japanese env. is better to be > stopped. > > > > So far as I know gnuplot would only start with encoding SJIS if the > > user's computer has current locale set to use sjis. > > > > Gnuplot's initialization is done in routine encoding_from_locale() in file > encoding.c. > > > > It first tries to use the system function > > l = setlocale(LC_CTYPE, ""); > > > > The man page says > > If locale is an empty string, "", each part of the locale that should be > modified is > > set according to the environment variables. The details are > implementation-dependent. > > For glibc, first (regardless of category), the environment variable LC_ALL > is in‐ > > spected, next the environment variable with the same name as the > category (see the ta‐ > > ble above), and finally the environment variable LANG. The first existing > environment > > variable is used. If its value is not a valid locale specification, the locale is > un‐ > > changed, and setlocale() returns NULL. > > > > On linux an appropriate japanese locale string is "ja_JP.UTF-8" > > but I know that Windows uses different names for locales. > > > > Do you know if your Japanese env. machine is returning a valid locale > specification at this > > point? If so, that is what gnuplot will use. If no valid return is detected, the > program > > then falls through to this code: > > #ifdef _WIN32 > > /* get encoding from currently active codepage */ > > if (encoding == S_ENC_INVALID) { > > #ifndef WGP_CONSOLE > > encoding = map_codepage_to_encoding(GetACP()); > > #else > > encoding = map_codepage_to_encoding(GetConsoleCP()); > > #endif > > } > > #endif > > > > So I think that to change the initial encoding in gnuplot, the user > > needs to either > > (1) set an appropriate environmental variable global to the session or > > (2) set the code page to CP65001. > > > > Is there a good place to find instructions on how to do this? > > Should we add a section to the installation instructions or the user manual? > > > > > > > > > > > > > > > > > > _______________________________________________ > gnuplot-beta mailing list > gnu...@li... > Membership management via: > https://lists.sourceforge.net/lists/listinfo/gnuplot-beta |