Skip to content

Commit

Permalink
Refs #9672 - Adds support for multi-byte EIT encodings.
Browse files Browse the repository at this point in the history
Thanks to moitinho for the original patch.
  • Loading branch information
stuarta committed May 5, 2011
1 parent 8596c4e commit 2d7a73e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 0 additions & 3 deletions mythtv/libs/libmythtv/eithelper.cpp
Expand Up @@ -982,9 +982,6 @@ static void init_fixup(QMap<uint64_t,uint> &fix)
fix[ 1094LL << 32 | 1 << 16 | 17028 ] = // NT1
fix[ 1100LL << 32 | 1 << 16 | 8710 ] = // NRJ 12
EITFixUp::kEFixForceISO8859_15;

// DVB-T TDT, Portugal (RTP 1, RTP 2, SIC, TVI)
fix[ 1101LL << 32 | 8904U << 16 ] = EITFixUp::kEFixForceISO8859_15;
}

static int calc_eit_utc_offset(void)
Expand Down
8 changes: 6 additions & 2 deletions mythtv/libs/libmythtv/mpeg/dvbdescriptors.cpp
Expand Up @@ -78,7 +78,7 @@ QString dvb_decode_text(const unsigned char *src, uint raw_length,
if (src[0] == 0x1f)
return freesat_huffman_to_string(src, raw_length);

if ((0x10 < src[0]) && (src[0] < 0x20))
if (((0x10 < src[0]) && (src[0] < 0x15)) || ((0x15 < src[0]) && (src[0] < 0x20)))
{
// TODO: Handle multi-byte encodings
VERBOSE(VB_SIPARSER, "dvb_decode_text: "
Expand Down Expand Up @@ -140,6 +140,10 @@ static QString decode_text(const unsigned char *buf, uint length)
else
return QString::fromLocal8Bit((char*)(buf + 3), length - 3);
}
else if (buf[0] == 0x15) // Already Unicode
{
return QString::fromUtf8((char*)(buf + 1), length - 1);
}
else
{
// Unknown/invalid encoding - assume local8Bit
Expand All @@ -158,7 +162,7 @@ QString dvb_decode_short_name(const unsigned char *src, uint raw_length)
return "";
}

if ((0x10 < src[0]) && (src[0] < 0x20))
if (((0x10 < src[0]) && (src[0] < 0x15)) || ((0x15 < src[0]) && (src[0] < 0x20)))
{
// TODO: Handle multi-byte encodings
VERBOSE(VB_SIPARSER, "dvb_decode_short_name: "
Expand Down

0 comments on commit 2d7a73e

Please sign in to comment.