From 06c55ac6c32a21419cfc55bbb773e922816991fe Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 22 Jan 2017 13:10:16 +0100 Subject: 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. --- misc/charset_conv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'misc/charset_conv.c') 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); } -- cgit v1.2.3