Fix detection of non UTF-8 locales
authorEric Biggers <ebiggers3@gmail.com>
Sun, 6 Mar 2016 23:17:46 +0000 (17:17 -0600)
committerEric Biggers <ebiggers3@gmail.com>
Sun, 6 Mar 2016 23:22:09 +0000 (17:22 -0600)
NEWS
src/wim.c

diff --git a/NEWS b/NEWS
index ac759ff..f7ed755 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -10,6 +10,8 @@ Version 1.9.1-BETA:
        Made some minor build-related updates.  Notably, enabled "silent" make
        rules; this makes the output cleaner when building from source.
 
+       Non UTF-8 locales are now detected correctly.
+
        Some Windows-specific updates:
                Fixed a bug where duplicate backslashes could be generated in
                link targets when extracting symbolic links and junctions.
index 79a9ba7..f6d1f3a 100644 (file)
--- a/src/wim.c
+++ b/src/wim.c
@@ -944,10 +944,10 @@ test_locale_ctype_utf8(void)
 #else
        char *ctype = nl_langinfo(CODESET);
 
-       return (!strstr(ctype, "UTF-8") ||
-               !strstr(ctype, "UTF8") ||
-               !strstr(ctype, "utf8") ||
-               !strstr(ctype, "utf-8"));
+       return (strstr(ctype, "UTF-8") ||
+               strstr(ctype, "UTF8") ||
+               strstr(ctype, "utf8") ||
+               strstr(ctype, "utf-8"));
 #endif
 }