From 93e5471ad948cc4504bb128f0b5fbb0a939fbcbf Mon Sep 17 00:00:00 2001 From: Andreas Monzner Date: Wed, 11 Oct 2006 12:29:11 +0000 Subject: convert radiotext to utf8 --- lib/python/Components/Converter/RadioText.py | 8 ++++++-- lib/python/Components/Sources/RadioText.py | 3 +-- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'lib/python') diff --git a/lib/python/Components/Converter/RadioText.py b/lib/python/Components/Converter/RadioText.py index 77ec58ed..e4499950 100644 --- a/lib/python/Components/Converter/RadioText.py +++ b/lib/python/Components/Converter/RadioText.py @@ -4,12 +4,16 @@ 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 if rt is None: return "N/A" - return rt - + text = rt.getRadioText() + if self.type == "RadioText-UTF8": + return text.decode("latin-1").encode("utf-8") + else: + return text text = property(getText) diff --git a/lib/python/Components/Sources/RadioText.py b/lib/python/Components/Sources/RadioText.py index 6faad317..de10ad81 100644 --- a/lib/python/Components/Sources/RadioText.py +++ b/lib/python/Components/Sources/RadioText.py @@ -16,8 +16,7 @@ class RadioText(PerServiceBase, Source, object): @cached def getText(self): service = self.navcore.getCurrentService() - info = service and service.radioText() - return info and info.getRadioText() + return service and service.radioText() radiotext = property(getText) -- cgit v1.2.3