diff options
| author | Felix Domke <tmbinc@elitedvb.net> | 2005-08-31 18:20:45 +0000 |
|---|---|---|
| committer | Felix Domke <tmbinc@elitedvb.net> | 2005-08-31 18:20:45 +0000 |
| commit | 4269ecde13580077c4d234b21784f704bf43e8fc (patch) | |
| tree | 424c0b80019cf49aac3421779902ffd9a2ab4ee2 | |
| parent | 169755aa6f9823ece2c51e720dbc4de6131c9308 (diff) | |
| download | enigma2-4269ecde13580077c4d234b21784f704bf43e8fc.tar.gz enigma2-4269ecde13580077c4d234b21784f704bf43e8fc.zip | |
- fix character conversion for DVB
| -rw-r--r-- | lib/base/estring.cpp | 8 | ||||
| -rw-r--r-- | lib/base/estring.h | 3 | ||||
| -rw-r--r-- | lib/dvb/db.cpp | 3 | ||||
| -rw-r--r-- | lib/service/event.cpp | 5 |
4 files changed, 14 insertions, 5 deletions
diff --git a/lib/base/estring.cpp b/lib/base/estring.cpp index f0107b6a..aee17429 100644 --- a/lib/base/estring.cpp +++ b/lib/base/estring.cpp @@ -3,6 +3,7 @@ #include <limits.h> #include <lib/base/elock.h> #include <lib/base/eerror.h> +#include <lib/base/estring.h> static pthread_mutex_t lock=PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP; @@ -181,7 +182,12 @@ static inline unsigned int recode(unsigned char d, int cp) } } -std::string convertDVBUTF8(unsigned char *data, int len, int table) +std::string convertDVBUTF8(const std::string &s, int table) +{ + return convertDVBUTF8((const unsigned char*)s.c_str(), s.size(), table); +} + +std::string convertDVBUTF8(const unsigned char *data, int len, int table) { int i; if (!len) diff --git a/lib/base/estring.h b/lib/base/estring.h index 9cc3180f..a0b161de 100644 --- a/lib/base/estring.h +++ b/lib/base/estring.h @@ -9,8 +9,9 @@ int strnicmp(const char*, const char*, int); std::string getNum(int num, int base=10); -std::string convertDVBUTF8(unsigned char *data, int len, int table=5); +std::string convertDVBUTF8(const unsigned char *data, int len, int table=5); std::string convertUTF8DVB(const std::string &string); // with default ISO8859-5 +std::string convertDVBUTF8(const std::string &s, int table=5); std::string convertLatin1UTF8(const std::string &string); int isUTF8(const std::string &string); diff --git a/lib/dvb/db.cpp b/lib/dvb/db.cpp index 067b0032..6e3207e0 100644 --- a/lib/dvb/db.cpp +++ b/lib/dvb/db.cpp @@ -2,6 +2,7 @@ #include <lib/dvb/db.h> #include <lib/dvb/frontend.h> #include <lib/base/eerror.h> +#include <lib/base/estring.h> #include <lib/dvb_si/sdt.h> #include <lib/dvb_si/descriptor_tag.h> #include <lib/dvb_si/service_descriptor.h> @@ -29,7 +30,7 @@ eDVBService &eDVBService::operator=(const eDVBService &s) RESULT eDVBService::getName(const eServiceReference &ref, std::string &name) { - name = m_service_name; + name = convertDVBUTF8(m_service_name); return 0; } diff --git a/lib/service/event.cpp b/lib/service/event.cpp index 58079da0..482527cc 100644 --- a/lib/service/event.cpp +++ b/lib/service/event.cpp @@ -1,4 +1,5 @@ #include <lib/service/event.h> +#include <lib/base/estring.h> #include <lib/dvb_si/eit.h> #include <lib/dvb_si/short_event_descriptor.h> #include <lib/dvb_si/descriptor_tag.h> @@ -17,8 +18,8 @@ RESULT eServiceEvent::parseFrom(Event *evt) case SHORT_EVENT_DESCRIPTOR: { const ShortEventDescriptor *sed = (ShortEventDescriptor*)*desc; - m_event_name = sed->getEventName(); - m_description = sed->getText(); + m_event_name = convertDVBUTF8(sed->getEventName()); + m_description = convertDVBUTF8(sed->getText()); break; } } |
