summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--misc/charset_conv.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/misc/charset_conv.c b/misc/charset_conv.c
index fcc346b37d..48e4e9a5ae 100644
--- a/misc/charset_conv.c
+++ b/misc/charset_conv.c
@@ -291,6 +291,11 @@ bstr mp_iconv_to_utf8(struct mp_log *log, bstr buf, const char *cp, int flags)
if (strcasecmp(cp, "UTF-8-BROKEN") == 0)
return bstr_sanitize_utf8_latin1(NULL, buf);
+ // Force CP949 over EUC-KR since iconv distinguishes them and
+ // EUC-KR causes error on CP949 encoded data
+ if (strcasecmp(cp, "EUC-KR") == 0)
+ cp = "CP949";
+
iconv_t icdsc;
if ((icdsc = iconv_open("UTF-8", cp)) == (iconv_t) (-1)) {
if (flags & MP_ICONV_VERBOSE)