diff options
author | Beniamino Galvani <bgalvani@redhat.com> | 2017-09-11 10:20:46 +0200 |
---|---|---|
committer | Beniamino Galvani <bgalvani@redhat.com> | 2017-09-12 23:46:51 +0200 |
commit | 789f8a6b51ebdd7cb6ba5c902c02e5a44a71ed68 (patch) | |
tree | 801e4534062e3ee952d514a2c4fbbf9252866126 | |
parent | 28a062748180534445b3996862c60de330d48dbf (diff) | |
download | NetworkManager-789f8a6b51ebdd7cb6ba5c902c02e5a44a71ed68.tar.gz |
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
-rw-r--r-- | libnm-core/nm-utils.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/libnm-core/nm-utils.c b/libnm-core/nm-utils.c index a234fe9094..9133af57d3 100644 --- a/libnm-core/nm-utils.c +++ b/libnm-core/nm-utils.c @@ -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); |