diff options
Diffstat (limited to 'libbb/unicode.c')
-rw-r--r-- | libbb/unicode.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/libbb/unicode.c b/libbb/unicode.c index d01efd9a2..99dc1dfa6 100644 --- a/libbb/unicode.c +++ b/libbb/unicode.c | |||
@@ -23,12 +23,13 @@ uint8_t unicode_status; | |||
23 | 23 | ||
24 | /* Unicode support using libc locale support. */ | 24 | /* Unicode support using libc locale support. */ |
25 | 25 | ||
26 | void FAST_FUNC reinit_unicode(const char *LANG UNUSED_PARAM) | 26 | void FAST_FUNC reinit_unicode(const char *LANG) |
27 | { | 27 | { |
28 | static const char unicode_0x394[] = { 0xce, 0x94, 0 }; | 28 | static const char unicode_0x394[] = { 0xce, 0x94, 0 }; |
29 | size_t width; | 29 | size_t width; |
30 | 30 | ||
31 | //TODO: call setlocale(LC_ALL, LANG) here? | 31 | //TODO: avoid repeated calls by caching last string? |
32 | setlocale(LC_ALL, (LANG && LANG[0]) ? LANG : "C"); | ||
32 | 33 | ||
33 | /* In unicode, this is a one character string */ | 34 | /* In unicode, this is a one character string */ |
34 | // can use unicode_strlen(string) too, but otherwise unicode_strlen() is unused | 35 | // can use unicode_strlen(string) too, but otherwise unicode_strlen() is unused |
@@ -39,7 +40,7 @@ void FAST_FUNC reinit_unicode(const char *LANG UNUSED_PARAM) | |||
39 | void FAST_FUNC init_unicode(void) | 40 | void FAST_FUNC init_unicode(void) |
40 | { | 41 | { |
41 | if (unicode_status == UNICODE_UNKNOWN) | 42 | if (unicode_status == UNICODE_UNKNOWN) |
42 | reinit_unicode(NULL /*getenv("LANG")*/); | 43 | reinit_unicode(getenv("LANG")); |
43 | } | 44 | } |
44 | 45 | ||
45 | #else | 46 | #else |