From: Andreas Monzner Date: Sun, 29 Oct 2006 01:10:35 +0000 (+0000) Subject: convert radiotext in c++ part to utf8 X-Git-Tag: 2.6.0~2822 X-Git-Url: https://git.cweiske.de/enigma2.git/commitdiff_plain/b332b11ee2f3fd450493b55507324c74d96b20e8 convert radiotext in c++ part to utf8 --- diff --git a/lib/python/Components/Converter/RadioText.py b/lib/python/Components/Converter/RadioText.py index 59885c0a..e69de29b 100644 --- a/lib/python/Components/Converter/RadioText.py +++ b/lib/python/Components/Converter/RadioText.py @@ -1,17 +0,0 @@ -from Components.Converter.Converter import Converter -from Components.Element import cached - -class RadioText(Converter, object): - def __init__(self, type): - Converter.__init__(self, type) - self.type = type - - @cached - def getText(self): - rt = self.source.radiotext - text = "" - if rt: - if self.type == "RadioText": - text = rt.getRadioText() - return text.decode("latin-1").encode("utf-8") - text = property(getText) diff --git a/lib/service/servicedvb.cpp b/lib/service/servicedvb.cpp index fe9398cb..077685f6 100644 --- a/lib/service/servicedvb.cpp +++ b/lib/service/servicedvb.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include #include #include // access to python config @@ -1364,7 +1365,7 @@ std::string eDVBServicePlay::getRadioText(int x) switch(x) { case 0: - return m_radiotext_parser->getCurrentText(); + return convertLatin1UTF8(m_radiotext_parser->getCurrentText()); } return ""; } @@ -2061,7 +2062,7 @@ PyObject *eDVBServicePlay::getSubtitleList() { PyObject *tuple = PyTuple_New(2); char desc[20]; - sprintf(desc, "Page %x", *i); + sprintf(desc, "Page %d", *i); PyTuple_SetItem(tuple, 0, PyString_FromString(desc)); PyTuple_SetItem(tuple, 1, PyInt_FromLong(*i)); PyList_Append(l, tuple);