diff options
author | Sebastian Pölsterl <sebp@k-d-w.org> | 2011-11-17 11:33:56 +0100 |
---|---|---|
committer | Tim-Philipp Müller <tim.muller@collabora.co.uk> | 2011-11-22 11:35:00 +0000 |
commit | 9759d66407f2be8ec29975b0eff3230bb1dae0ef (patch) | |
tree | 1e46c0dcdda2fad986e7c701eef35f5977d4c36e | |
parent | aa4b5b3bf5e9b5a0a8aaf2019d57ab40ef2fdd2c (diff) | |
download | gstreamer-plugins-bad-9759d66407f2be8ec29975b0eff3230bb1dae0ef.tar.gz |
mpegtsparse: support more character set encodings
Support UTF-16BE, EUC-KR (KSX1001), GB2312 and ISO-10646/UTF8 text
encoding and fixed new line for multibyte encoding
https://bugzilla.gnome.org/show_bug.cgi?id=664257
-rw-r--r-- | gst/mpegdemux/mpegtspacketizer.c | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/gst/mpegdemux/mpegtspacketizer.c b/gst/mpegdemux/mpegtspacketizer.c index 118a3acc5..ed1d0ac0e 100644 --- a/gst/mpegdemux/mpegtspacketizer.c +++ b/gst/mpegdemux/mpegtspacketizer.c @@ -2390,13 +2390,22 @@ get_encoding (const gchar * text, guint * start_text, gboolean * is_multibyte) *start_text = 1; *is_multibyte = TRUE; } else if (firstbyte == 0x12) { - /* That's korean encoding. - * The spec says it's encoded in KSC 5601, but iconv only knows KSC 5636. - * Couldn't find any information about either of them. - */ - encoding = NULL; + /* EUC-KR implements KSX1001 */ + encoding = g_strdup ("EUC-KR"); *start_text = 1; *is_multibyte = TRUE; + } else if (firstbyte == 0x13) { + encoding = g_strdup ("GB2312"); + *start_text = 1; + *is_multibyte = FALSE; + } else if (firstbyte == 0x14) { + encoding = g_strdup ("UTF-16BE"); + *start_text = 1; + *is_multibyte = TRUE; + } else if (firstbyte == 0x15) { + encoding = g_strdup ("ISO-10646/UTF8"); + *start_text = 1; + *is_multibyte = FALSE; } else { /* reserved */ encoding = NULL; @@ -2448,7 +2457,7 @@ convert_to_utf8 (const gchar * text, gint length, guint start, /* skip it */ break; case 0xE08A:{ - guint8 nl[] = { 0x0A, 0x00 }; /* new line */ + guint8 nl[] = { 0x00, 0x0A }; /* new line */ g_byte_array_append (sb, nl, 2); break; } @@ -2469,7 +2478,7 @@ convert_to_utf8 (const gchar * text, gint length, guint start, /* skip it */ break; case 0xE08A:{ - guint8 nl[] = { 0x0A, 0x00 }; /* new line */ + guint8 nl[] = { 0x00, 0x0A }; /* new line */ g_byte_array_append (sb, nl, 2); break; } |