From 8f8877430cfcc9e2bca6d5066241600a8742c1ac Mon Sep 17 00:00:00 2001 From: Jumper78 <52802286+Jumper78@users.noreply.github.com> Date: Wed, 21 Sep 2022 17:52:55 +0200 Subject: [PATCH] Added support for ATSC text mode == 0x3F Added support for ATSC text mode == 0x3F handling of ATSC text mode == 0x3F (Select Unicode, UTF-16 Form) is added by calling atsc_utf16_to_utf8 + change to bytecount instead of srclen --- src/input/mpegts/dvb_support.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/input/mpegts/dvb_support.c b/src/input/mpegts/dvb_support.c index 2656c700a..d73673126 100644 --- a/src/input/mpegts/dvb_support.c +++ b/src/input/mpegts/dvb_support.c @@ -504,6 +504,17 @@ atsc_get_string } *bufpointer = '\0'; + if (ls == NULL) + ls = lang_str_create(); + lang_str_append(ls, buf, langcode); + } else if (compressiontype == 0 && mode == 0x3F) { + tvhtrace(LS_MPEGTS, "atsc-str: %d: comptype 0x%02x, mode 0x%02x, %d bytes: '%.*s'", + j, compressiontype, mode, bytecount, bytecount, src); + + /* let the atsc_utf16_to_utf8 function do the conversion; + * bytecount/2: since the function is handling both utf16 bytes in one count only half the length is needed */ + atsc_utf16_to_utf8(src, bytecount/2, buf, bufferSize); + if (ls == NULL) ls = lang_str_create(); lang_str_append(ls, buf, langcode); @@ -515,7 +526,6 @@ atsc_get_string * - compression type == 0x3 .. 0xFF (reserved) * * - text mode == 0x3E (Standard Compression Scheme for Unicode) - * - text mode == 0x3F (Select Unicode, UTF-16 Form) * - text mode == 0x40, 0x41 (ATSC Standard for Taiwan) * - text mode == 0x48 (ATSC Standard for South Korea) * -- 2.47.2