aboutsummaryrefslogtreecommitdiff
path: root/lib/base
diff options
context:
space:
mode:
authorghost <andreas.monzner@multimedia-labs.de>2009-07-28 15:35:00 +0200
committerghost <andreas.monzner@multimedia-labs.de>2009-07-28 15:35:00 +0200
commit8bea76d0df509b8d3f570d67a1855efa49c3eaaf (patch)
tree0a536fd30e71d93515895c95cca1fdc1172a990d /lib/base
parente448808c8c2faf89397318e61fd83259835d1977 (diff)
downloadenigma2-8bea76d0df509b8d3f570d67a1855efa49c3eaaf.tar.gz
enigma2-8bea76d0df509b8d3f570d67a1855efa49c3eaaf.zip
Revert "more standard conform handling for dvb-text encodings"
This reverts commit efdb7161844b7be58cdc5ec3308d8aaf5b257894.
Diffstat (limited to 'lib/base')
-rw-r--r--lib/base/encoding.cpp2
-rw-r--r--lib/base/estring.cpp17
-rw-r--r--lib/base/estring.h4
3 files changed, 6 insertions, 17 deletions
diff --git a/lib/base/encoding.cpp b/lib/base/encoding.cpp
index e4e1531c..8b4b592b 100644
--- a/lib/base/encoding.cpp
+++ b/lib/base/encoding.cpp
@@ -83,5 +83,5 @@ int eDVBTextEncodingHandler::getCountryCodeDefaultMapping( const std::string &co
m_CountryCodeDefaultMapping.find(country_code);
if ( it != m_CountryCodeDefaultMapping.end() )
return it->second;
- return 0; // Latin1/ISO6397
+ return 1; // ISO8859-1 / Latin1
}
diff --git a/lib/base/estring.cpp b/lib/base/estring.cpp
index 40b98028..e7dc2bec 100644
--- a/lib/base/estring.cpp
+++ b/lib/base/estring.cpp
@@ -325,7 +325,7 @@ static inline unsigned int recode(unsigned char d, int cp)
return d;
switch (cp)
{
- case 0: // Latin1/ISO6397 <-> unicode mapping
+ case 0: // ISO6397
return iso6397[d-0xA0];
case 1: // 8859-1 <-> unicode mapping
return d;
@@ -371,10 +371,6 @@ std::string convertDVBUTF8(const unsigned char *data, int len, int table, int ts
int i=0, t=0;
- // table given two this function is default 0... but when a default table for a country code is set in encoding.conf
- // then here this table is given
-
- // when a tsid/onid is avail the table can be overriden in encoding.conf based on tsid/onid combinations
if ( tsidonid )
encodingHandler.getTransponderDefaultMapping(tsidonid, table);
@@ -403,7 +399,7 @@ std::string convertDVBUTF8(const unsigned char *data, int len, int table, int ts
}
case 0x11: // Basic Multilingual Plane of ISO/IEC 10646-1 enc (UTF-16... Unicode)
table = 65;
-// eDebug("(0x11)text encoded in ISO-10646-1 (UTF-16)");
+ tsidonid = 0;
++i;
break;
case 0x12:
@@ -426,22 +422,15 @@ std::string convertDVBUTF8(const unsigned char *data, int len, int table, int ts
eDebug("reserved %d", data[0]);
++i;
break;
- default:
-// eDebug("no encoding in dvb string given.. use default table %d", table);
- break;
}
- bool useTwoCharMapping = (!table) || (tsidonid && encodingHandler.getTransponderUseTwoCharMapping(tsidonid));
- // two char byte mapping is default enabled for table 0 (ISO6397) (described in ETSI EN300468)
- // or it can be enabled for tsid/onid combinations in our encoding.conf
+ bool useTwoCharMapping = !table || tsidonid && encodingHandler.getTransponderUseTwoCharMapping(tsidonid);
if (useTwoCharMapping && table == 5) { // i hope this dont break other transponders which realy use ISO8859-5 and two char byte mapping...
// eDebug("Cyfra / Cyfrowy Polsat HACK... override given ISO8859-5 with ISO6397");
table = 0;
}
-// eDebug("tsid %04x, onid %04x, used table is now %d, twoChar %d", tsidonid >> 16, tsidonid & 0xFFFF, table, useTwoCharMapping);
-
unsigned char res[2048];
while (i < len)
{
diff --git a/lib/base/estring.h b/lib/base/estring.h
index d61489eb..99b839bd 100644
--- a/lib/base/estring.h
+++ b/lib/base/estring.h
@@ -12,7 +12,7 @@ int strnicmp(const char*, const char*, int);
std::string getNum(int num, int base=10);
-std::string convertDVBUTF8(const unsigned char *data, int len, int table=0, int tsidonid=0); // with default ISO8859-1/Latin1
+std::string convertDVBUTF8(const unsigned char *data, int len, int table=1, int tsidonid=0); // with default ISO8859-1 / Latin1
std::string convertLatin1UTF8(const std::string &string);
int isUTF8(const std::string &string);
@@ -20,7 +20,7 @@ std::string removeDVBChars(const std::string &s);
void makeUpper(std::string &s);
std::string replace_all(const std::string &in, const std::string &entity, const std::string &symbol);
-inline std::string convertDVBUTF8(const std::string &string, int table=0, int tsidonid=0) // with default ISO8859-1/Latin1
+inline std::string convertDVBUTF8(const std::string &string, int table=1, int tsidonid=0) // with default ISO8859-1 / Latin1
{
return convertDVBUTF8((const unsigned char*)string.c_str(), string.length(), table, tsidonid);
}