summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--misc/charset_conv.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/misc/charset_conv.c b/misc/charset_conv.c
index 8181b1392e..0037775586 100644
--- a/misc/charset_conv.c
+++ b/misc/charset_conv.c
@@ -186,6 +186,8 @@ static const char *mp_uchardet(void *talloc_ctx, struct mp_log *log, bstr buf)
iconv_close(icdsc);
}
}
+ if (!res && bstr_validate_utf8(buf) >= 0)
+ res = "utf-8";
uchardet_delete(det);
return res;
}