convert radiotext in c++ part to utf8
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>
Sun, 29 Oct 2006 01:10:35 +0000 (01:10 +0000)
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>
Sun, 29 Oct 2006 01:10:35 +0000 (01:10 +0000)
lib/python/Components/Converter/RadioText.py
lib/service/servicedvb.cpp

index 59885c0a689602ed8d1b0f4aa6c8288421eafa58..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -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)
index fe9398cbb86ca9b470576f99a34bb62f967a7f84..077685f6f2b4bc6bba6afc640b3b5306131133b1 100644 (file)
@@ -3,6 +3,7 @@
 #include <string>
 #include <lib/service/servicedvb.h>
 #include <lib/service/service.h>
+#include <lib/base/estring.h>
 #include <lib/base/init_num.h>
 #include <lib/base/init.h>
 #include <lib/base/nconfig.h> // 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);