unicode: check $LC_ALL to detect Unicode mode, not only $LANG
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
ea267d518f
commit
3e7ecb179b
3 changed files with 18 additions and 6 deletions
|
@ -39,8 +39,11 @@ void FAST_FUNC reinit_unicode(const char *LANG)
|
|||
|
||||
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
|
||||
|
@ -58,8 +61,11 @@ void FAST_FUNC reinit_unicode(const char *LANG)
|
|||
|
||||
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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue