]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
Added support for ATSC text mode == 0x3F
authorJumper78 <52802286+Jumper78@users.noreply.github.com>
Wed, 21 Sep 2022 15:52:55 +0000 (17:52 +0200)
committerFlole998 <Flole998@users.noreply.github.com>
Mon, 3 Oct 2022 22:12:03 +0000 (00:12 +0200)
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

index 2656c700af05347b3d39f0493f8b73b1e52bcee0..d73673126748adf5a8b5b75532e18b47451231df 100644 (file)
@@ -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)
          *