From da4f11803febd0e75d3d62a965e17731bd328506 Mon Sep 17 00:00:00 2001 From: Dudemanguy Date: Sun, 1 Oct 2023 13:21:56 -0500 Subject: 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). --- misc/charset_conv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'misc/charset_conv.c') 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"; } -- cgit v1.2.3