From 16e31523ba9d4c53a38f6420b83561b4ca56cc79 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 6 Feb 2020 14:29:25 -0500 Subject: 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 --- Utilities/cmlibarchive/libarchive/archive_string.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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); } -- cgit v0.12