summaryrefslogtreecommitdiffstats
path: root/misc/charset_conv.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-01-22 13:10:16 +0100
committerwm4 <wm4@nowhere>2017-01-22 13:10:16 +0100
commit06c55ac6c32a21419cfc55bbb773e922816991fe (patch)
tree1087f738844481791c31478b46edee9301cfe8df /misc/charset_conv.c
parent310671e91a59b5f1841127fb540c5ceac21979ec (diff)
downloadmpv-06c55ac6c32a21419cfc55bbb773e922816991fe.tar.bz2
mpv-06c55ac6c32a21419cfc55bbb773e922816991fe.tar.xz
charset_conv: fallback to interpreting subs as latin1 if iconv fails
For display purposes, it's better to show scrambled text - at least that's a more actionable failure mode than spamming the terminal with FFmpeg nonsense error messages. This avoids the obnoxious and pointless "Invalid UTF-8 in decoded subtitles text; maybe missing -sub_charenc option" FFmpeg error, which will be spammed on every single subtitle event. We don't even have a -sub-charenc option, fuck FFmpeg. Did I mention fuck FFmpeg yet? Because fuck FFmpeg.
Diffstat (limited to 'misc/charset_conv.c')
-rw-r--r--misc/charset_conv.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/misc/charset_conv.c b/misc/charset_conv.c
index 5c38cfad0e..7dc1a87783 100644
--- a/misc/charset_conv.c
+++ b/misc/charset_conv.c
@@ -234,5 +234,5 @@ bstr mp_iconv_to_utf8(struct mp_log *log, bstr buf, const char *cp, int flags)
#endif
failure:
- return (bstr){0};
+ return bstr_sanitize_utf8_latin1(NULL, buf);
}