From: John Starks Date: Mon, 23 Jul 2018 22:37:09 +0000 (-0700) Subject: windows: Support UTF-8 locale X-Git-Tag: v3.4.0~105^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c46e79934b8fb6d260882fde7c5e2858ebeaa728;p=thirdparty%2Flibarchive.git windows: Support UTF-8 locale Newer versions of the Windows CRT can return locales that are suffixed with .utf8 instead of an integer code page. --- diff --git a/libarchive/archive_string.c b/libarchive/archive_string.c index 554533ecb..18ad82d1e 100644 --- a/libarchive/archive_string.c +++ b/libarchive/archive_string.c @@ -1512,8 +1512,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); }