summaryrefslogtreecommitdiffstats
path: root/misc/charset_conv.c
diff options
context:
space:
mode:
authorDudemanguy <random342@airmail.cc>2023-10-01 13:21:56 -0500
committerDudemanguy <random342@airmail.cc>2023-10-07 02:41:27 +0000
commitda4f11803febd0e75d3d62a965e17731bd328506 (patch)
tree1005b2176a25dd45080f6b699697fa6399f96fb1 /misc/charset_conv.c
parent50b23a8c4493517fa2130250d22d94bca4e27804 (diff)
downloadmpv-da4f11803febd0e75d3d62a965e17731bd328506.tar.bz2
mpv-da4f11803febd0e75d3d62a965e17731bd328506.tar.xz
demux: change the default of metadata-codepage to auto
There's really no reason not to do this especially since sub-codepage already defaults to auto. Also change logging in charset_conv since telling us that the data is UTF-8 if the passed codepage value is "auto" or "utf-8" is really not useful information (that's the expectation).
Diffstat (limited to 'misc/charset_conv.c')
-rw-r--r--misc/charset_conv.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/misc/charset_conv.c b/misc/charset_conv.c
index f649057fe8..3668f3b652 100644
--- a/misc/charset_conv.c
+++ b/misc/charset_conv.c
@@ -114,7 +114,8 @@ const char *mp_charset_guess(void *talloc_ctx, struct mp_log *log, bstr buf,
int r = bstr_validate_utf8(buf);
if (r >= 0 || (r > -8 && (flags & MP_ICONV_ALLOW_CUTOFF))) {
- mp_verbose(log, "Data looks like UTF-8, ignoring user-provided charset.\n");
+ if (strcmp(user_cp, "auto") != 0 && !mp_charset_is_utf8(user_cp))
+ mp_verbose(log, "Data looks like UTF-8, ignoring user-provided charset.\n");
return "utf-8";
}