libnm-core: also consider LC_ALL and LC_CTYPE to guess SSID charset
Also consider LC_ALL and LC_CTYPE environment variables, in addition to LANG, to determine the charset used for converting SSIDs to UTF-8. https://bugzilla.gnome.org/show_bug.cgi?id=784415
This commit is contained in:
@@ -201,8 +201,13 @@ get_system_encodings (void)
|
||||
if (cached_encodings)
|
||||
return cached_encodings;
|
||||
|
||||
/* LANG may be a good encoding hint */
|
||||
if ((lang = getenv ("LANG"))) {
|
||||
/* Use environment variables as encoding hint */
|
||||
lang = getenv ("LC_ALL");
|
||||
if (!lang)
|
||||
lang = getenv ("LC_CTYPE");
|
||||
if (!lang)
|
||||
lang = getenv ("LANG");
|
||||
if (lang) {
|
||||
char *dot;
|
||||
|
||||
lang = g_ascii_strdown (lang, -1);
|
||||
|
Reference in New Issue
Block a user