From c46e79934b8fb6d260882fde7c5e2858ebeaa728 Mon Sep 17 00:00:00 2001 From: John Starks Date: Mon, 23 Jul 2018 15:37:09 -0700 Subject: [PATCH] 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. --- libarchive/archive_string.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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); } -- 2.47.2