diff options
author | Brad King <brad.king@kitware.com> | 2020-02-06 19:29:25 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-02-06 20:04:47 (GMT) |
commit | 16e31523ba9d4c53a38f6420b83561b4ca56cc79 (patch) | |
tree | 8947a2c83a4cd143de870437febb588580955fe3 | |
parent | f7c54d2049b28414be75d1792542722e82b7ed64 (diff) | |
download | CMake-16e31523ba9d4c53a38f6420b83561b4ca56cc79.zip CMake-16e31523ba9d4c53a38f6420b83561b4ca56cc79.tar.gz CMake-16e31523ba9d4c53a38f6420b83561b4ca56cc79.tar.bz2 |
libarchive: Add support for UTF-8 locale on Windows
Backport libarchive upstream commit `c46e7993` (windows: Support UTF-8
locale, 2018-07-23, v3.4.0~105^2).
Fixes: #20320
-rw-r--r-- | Utilities/cmlibarchive/libarchive/archive_string.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Utilities/cmlibarchive/libarchive/archive_string.c b/Utilities/cmlibarchive/libarchive/archive_string.c index 9df76ff..85594cc 100644 --- a/Utilities/cmlibarchive/libarchive/archive_string.c +++ b/Utilities/cmlibarchive/libarchive/archive_string.c @@ -1513,8 +1513,10 @@ get_current_codepage(void) p = strrchr(locale, '.'); if (p == NULL) return (GetACP()); + if (strcmp(p+1, "utf8") == 0) + return CP_UTF8; cp = my_atoi(p+1); - if (cp <= 0) + if ((int)cp <= 0) return (GetACP()); return (cp); } |