diff --git a/DOCS/interface-changes.rst b/DOCS/interface-changes.rst index b9fbb9739c..62d271bcb1 100644 --- a/DOCS/interface-changes.rst +++ b/DOCS/interface-changes.rst @@ -97,6 +97,7 @@ Interface changes - add `--window-affinity` option - `--config-dir` no longer forces cache and state files to also reside in there - deprecate `--demuxer-cue-codepage` in favor of `--metadata-codepage` + - change the default of `metadata-codepage` to `auto` --- mpv 0.36.0 --- - add `--target-contrast` - Target luminance value is now also applied when ICC profile is used. diff --git a/DOCS/man/options.rst b/DOCS/man/options.rst index eb1fc01542..df8ff154e4 100644 --- a/DOCS/man/options.rst +++ b/DOCS/man/options.rst @@ -7315,10 +7315,9 @@ Miscellaneous filters. ``--metadata-codepage=`` - Codepage for various input metadata (default: ``utf-8``). This affects how - file tags, chapter titles, etc. are interpreted. You can for example set - this to ``auto`` to enable autodetection of the codepage. (This is not the - default because non-UTF-8 codepages are an obscure fringe use-case.) + Codepage for various input metadata (default: ``auto``). This affects how + file tags, chapter titles, etc. are interpreted. In most cases, this merely + evaluates to UTF-8 as non-UTF-8 codepages are obscure. See ``--sub-codepage`` option on how codepages are specified and further details regarding autodetection and codepage conversion. (The underlying diff --git a/demux/demux.c b/demux/demux.c index d3da4a0fd1..e0b585e376 100644 --- a/demux/demux.c +++ b/demux/demux.c @@ -142,7 +142,7 @@ const struct m_sub_options demux_conf = { [STREAM_VIDEO] = 1, [STREAM_AUDIO] = 10, }, - .meta_cp = "utf-8", + .meta_cp = "auto", }, .get_sub_options = get_demux_sub_opts, }; 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"; }