void FAST_FUNC init_unicode(void)
{
- if (unicode_status == UNICODE_UNKNOWN)
- reinit_unicode(getenv("LANG"));
+ if (unicode_status == UNICODE_UNKNOWN) {
+ char *s = getenv("LC_ALL");
+ if (!s) s = getenv("LANG");
+ reinit_unicode(s);
+ }
}
#else
void FAST_FUNC init_unicode(void)
{
- if (unicode_status == UNICODE_UNKNOWN)
- reinit_unicode(getenv("LANG"));
+ if (unicode_status == UNICODE_UNKNOWN) {
+ char *s = getenv("LC_ALL");
+ if (!s) s = getenv("LANG");
+ reinit_unicode(s);
+ }
}
# endif
* _during_ shell execution, not only if it was set when
* shell was started. Therefore, re-check LANG every time:
*/
- reinit_unicode(lookupvar("LANG"));
+ {
+ const char *s = lookupvar("LC_ALL");
+ if (!s) s = lookupvar("LANG");
+ reinit_unicode(s);
+ }
nr = read_line_input(line_input_state, cmdedit_prompt, buf, IBUFSIZ, timeout);
if (nr == 0) {
/* Ctrl+C pressed */
* _during_ shell execution, not only if it was set when
* shell was started. Therefore, re-check LANG every time:
*/
- reinit_unicode(get_local_var_value("LANG"));
+ const char *s = get_local_var_value("LC_ALL");
+ if (!s) s = get_local_var_value("LANG");
+ reinit_unicode(s);
G.flag_SIGINT = 0;
/* buglet: SIGINT will not make new prompt to appear _at once_,