From c915cdad868baf2ac74112af6d6ef3478d93aa53 Mon Sep 17 00:00:00 2001 From: satbaby Date: Sun, 25 Dec 2011 13:32:19 +0000 Subject: [PATCH] edvbstring: dont use ISO6937 as default git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@2003 e54a6e83-5905-42d5-8d5c-058d10e6a962 --- data/encoding.conf | 63 +++++++++++++++++++++++------------- src/sectionsd/edvbstring.cpp | 19 +++++++---- 2 files changed, 53 insertions(+), 29 deletions(-) diff --git a/data/encoding.conf b/data/encoding.conf index e84b4e55c..074ec7593 100644 --- a/data/encoding.conf +++ b/data/encoding.conf @@ -8,22 +8,25 @@ bul ISO8859-5 cn ISO3166-2 #Table of transponder using two byte char mappings (VideoTexSuppl) #TSID ONID -# sky -0x1 0x85 ISO8859-1 -0x2 0x85 ISO8859-1 -0x3 0x85 ISO8859-1 -0x4 0x85 ISO8859-1 -0x5 0x85 ISO8859-1 -0x6 0x85 ISO8859-1 -0x7 0x85 ISO8859-1 -0xB 0x85 ISO8859-1 -0xC 0x85 ISO8859-1 -0xD 0x85 ISO8859-1 -0xE 0x85 ISO8859-1 -0xF 0x85 ISO8859-1 -0x11 0x85 ISO8859-1 -0x21 0x85 ISO8859-1 +0x441 0x1 ISO6937 # RTL +0x443 0x1 ISO6937 # Eurosport / RTL Austria # +0x447 0x1 #ASTRA 19.2° UPC Direct +0x427 0x1 #ASTRA 19.2° UPC Direct +0x44b 0x1 #ASTRA 19.2° UPC Direct +0x4ff 0x1 #ASTRA 19.2° UPC Direct +0x407 0x1 #ASTRA 19.2° UPC Direct +0x436 0x1 #ASTRA 19.2° MTV Euro - MTV Networks +0x42a 0x1 #ASTRA 19.2° VH1 Classic - MTV Networks +0xc23 0x3 #ASTRA 23.5° CzechLink +0xc93 0x3 #ASTRA 23.5° CzechLink +0xc95 0x3 #ASTRA 23.5° CzechLink +0xc8b 0x3 #ASTRA 23.5° CzechLink +0xc89 0x3 #ASTRA 23.5° CzechLink +0xbc7 0x3 #ASTRA 23.5° CzechLink +0xc8f 0x3 #ASTRA 23.5° CzechLink +0xc85 0x3 #ASTRA 23.5° CzechLink +0xbc6 0x3 #ASTRA 23.5° CzechLink #TSID ONID 0x1 0x601 #UPC Cable Hungary 0x2 0x601 #UPC Cable Hungary @@ -56,14 +59,28 @@ cn ISO3166-2 0x1 0x1111 0x2 0x1111 0x3 0x1111 -11000 318 #Hotbird 13.0° Cyfra+ -11900 318 -11400 318 -12200 318 -13200 113 -1500 318 -400 318 -0x5dc 0x13e +200 318 #Hotbird Eutelsat (Eurosport) +300 318 #Hotbird Eutelsat (Eurosport, Animal Pl.HD) +400 318 #Hotbird 13.0 Cyfra+ +1000 318 #Hotbird 13.0 Grupa ITI +1500 318 #Hotbird 13.0 Cyfra+ +1600 318 #Hotbird 13.0 Cyfra+ +2800 318 #Hotbird 13.0 MTV Networks (Comedy Central) +7400 113 #Hotbird 13.0 Cyfrowy Polsat +7800 113 #Hotbird 13.0 Cyfrowy Polsat +7900 113 #Hotbird 13.0 Cyfrowy Polsat +8100 113 #Hotbird 13.0 Universal (Cyfra+) +8100 318 #Hotbird 13.0 Eutelsat (Universal) +11000 318 #Hotbird 13.0 Cyfra+ +11400 318 #Hotbird 13.0 Cyfra+ +11600 318 #Hotbird 13.0 BBC HD, ITI +11700 318 #Hotbird 13.0 Eurosport2 +11900 318 #Hotbird 13.0 Cyfra+ +12200 318 #Hotbird 13.0 Disney Channel Polska and other +12800 318 #Hotbird 13.0 Viacom ... MTV / VH1 Polska +13000 318 #Hotbird 13.0 BBC Polska and other +13100 318 #Hotbird 13.0 Crime and Investigation +13200 113 #Hotbird 13.0 Cyfrowy Polsat #Fallback encoding table for following transponders #TSID ONID ISO8859-X #0x447 0x1 ISO8859-9 diff --git a/src/sectionsd/edvbstring.cpp b/src/sectionsd/edvbstring.cpp index 14ceef95e..62bc05b77 100644 --- a/src/sectionsd/edvbstring.cpp +++ b/src/sectionsd/edvbstring.cpp @@ -28,9 +28,9 @@ int readEncodingFile() else if ( (sscanf( line, "0x%x 0x%x ISO8859-%d", &tsid, &onid, &encoding ) == 3 ) ||(sscanf( line, "%d %d ISO8859-%d", &tsid, &onid, &encoding ) == 3 ) ) TransponderDefaultMapping[(tsid<<16)|onid]=encoding; - else if ( (sscanf( line, "0x%x 0x%x ISO%d", &tsid, &onid, &encoding ) == 3 && encoding == 6397 ) - ||(sscanf( line, "%d %d ISO%d", &tsid, &onid, &encoding ) == 3 && encoding == 6397 ) ) - TransponderDefaultMapping[(tsid<<16)|onid]=0; + else if ( (sscanf( line, "0x%x 0x%x ISO%d", &tsid, &onid, &encoding ) == 3 && encoding == 6937 ) + ||(sscanf( line, "%d %d ISO%d", &tsid, &onid, &encoding ) == 3 && encoding == 6937 ) ) + TransponderDefaultMapping[(tsid<<16)|onid]=64; else if ( (sscanf( line, "0x%x 0x%x", &tsid, &onid ) == 2 ) ||(sscanf( line, "%d %d", &tsid, &onid ) == 2 ) ) TransponderUseTwoCharMapping.insert((tsid<<16)|onid); @@ -168,7 +168,7 @@ static unsigned long c885916[96]= { 0x00E0, 0x00E1, 0x00E2, 0x0103, 0x00E4, 0x0107, 0x00E6, 0x00E7, 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF, 0x0111, 0x0144, 0x00F2, 0x00F3, 0x00F4, 0x0151, 0x00F6, 0x015B, 0x0171, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x0119, 0x021B, 0x00FF }; -static unsigned long iso6397[96]={ +static unsigned long iso6937[96]={ 0x00A0, 0x00A1, 0x00A2, 0x00A3, 0x20AC, 0x00A5, 0x0000, 0x00A7, 0x00A4, 0x2018, 0x201C, 0x00AB, 0x2190, 0x2191, 0x2192, 0x2193, 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00D7, 0x00B5, 0x00B6, 0x00B7, 0x00F7, 0x2019, 0x201D, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00BF, 0x0000, 0xE002, 0xE003, 0xE004, 0xE005, 0xE006, 0xE007, 0xE008, 0xE009, 0xE00C, 0xE00A, 0xE00B, 0x0000, 0xE00D, 0xE00E, 0xE00F, @@ -556,8 +556,7 @@ static inline unsigned int recode(unsigned char d, int cp) return d; switch (cp) { - case 0: // ISO6397 - return iso6397[d-0xA0]; + case 0: // Latin1 <-> unicode mapping case 1: // 8859-1 <-> unicode mapping return d; case 2: // 8859-2 -> unicode mapping @@ -590,6 +589,8 @@ static inline unsigned int recode(unsigned char d, int cp) return c885915[d-0xA0]; case 16:// 8859-16 -> unicode mapping return c885916[d-0xA0]; + case 64:// ISO6937 + return iso6937[d-0xA0]; default: return d; } @@ -610,6 +611,7 @@ std::string convertDVBUTF8(const char *data, int len, int table, int tsidonid) TransponderDefaultMapping.find(tsidonid); if ( it != TransponderDefaultMapping.end() ) table = it->second; + twochar = TransponderUseTwoCharMapping.find(tsidonid) != TransponderUseTwoCharMapping.end(); } //printf("table %d tsidonid %04x twochar %d : %20s\n", table, tsidonid, twochar, data); @@ -658,8 +660,13 @@ std::string convertDVBUTF8(const char *data, int len, int table, int tsidonid) ++i; break; } + if(!table) table = newtable; + if(table == 64 && (newtable !=0 )){//for ISO6937 + table = newtable; + } + //dprintf("recode:::: tsidonid %X table %d two-char %d len %d\n", tsidonid, table, twochar, len); unsigned char res[2048]; while (i < len)