1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-10-15 20:46:37 +08:00

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
This commit is contained in:
Brad King
2020-02-06 14:29:25 -05:00
parent f7c54d2049
commit 16e31523ba

View File

@@ -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);
}