#It IS used (dynamically)
from WebScreens import *
#DO NOT REMOVE THIS IMPORT
-
+
+
+global screen_cache
+screen_cache = {}
# The classes and Function in File handle all ScreenPage-based requests
# ScreenPages use enigma2 standard functionality to bring contents to a webfrontend
Converter.__init__(self, arg)
def getHTML(self, id):
- return self.source.text.replace('\xc2\x86', '').replace('\xc2\x87', '') # encode & etc. here!
+ return self.source.text.replace('\xc2\x86', '').replace('\xc2\x87', '').decode("utf-8", "ignore").encode("utf-8") # encode & etc. here!
#===============================================================================
# TextToXML
Converter.__init__(self, arg)
def getHTML(self, id):
- return escape_xml(self.source.text).replace("\x19", "").replace("\x1c", "").replace("\x1e", "").replace('\xc2\x86', '').replace('\xc2\x87', '')
+ return escape_xml(self.source.text).replace('\xc2\x86', '').replace('\xc2\x87', '').replace("\x19", "").replace("\x1c", "").replace("\x1e", "").decode("utf-8", "ignore").encode("utf-8")
#===============================================================================
# TextToURL
Converter.__init__(self, arg)
def getHTML(self, id):
- return self.source.text.replace(" ", "%20").replace("+", "%2b").replace("&", "%26").replace('\xc2\x86', '').replace('\xc2\x87', '')
+ return self.source.text.replace(" ", "%20").replace("+", "%2b").replace("&", "%26").replace('\xc2\x86', '').replace('\xc2\x87', '').decode("utf-8", "ignore").encode("utf-8")
#===============================================================================
# ReturnEmptyXML
item = ""
for (element, filternum) in list:
- item = str(item).replace('\xc2\x86', '').replace('\xc2\x87', '')
+ #filter out "non-displayable" Characters - at the very end, do it the hard way...
+ item = str(item).replace('\xc2\x86', '').replace('\xc2\x87', '').replace("\x19", "").replace("\x1c", "").replace("\x1e", "").decode("utf-8", "ignore").encode("utf-8")
if not filternum:
append(element)
elif filternum == 2:
append(item.replace("\\", "\\\\").replace("\n", "\\n").replace('"', '\\"'))
elif filternum == 3:
- append(escape_xml( item.replace("\x19", "").replace("\x1c", "").replace("\x1e", "").replace('\xc2\x86', '').replace('\xc2\x87', '') ))
+ append(escape_xml(item))
elif filternum == 4:
append(item.replace("%", "%25").replace("+", "%2B").replace('&', '%26').replace('?', '%3f').replace(' ', '+'))
elif filternum == 5:
#None becomes ""
curitem = ""
if filternum:
- curitem = str(item[element]).replace('\xc2\x86', '').replace('\xc2\x87', '')
+ #filter out "non-displayable" Characters - at the very end, do it the hard way...
+ curitem = str(item[element]).replace('\xc2\x86', '').replace('\xc2\x87', '').replace("\x19", "").replace("\x1c", "").replace("\x1e", "").decode("utf-8", "ignore").encode("utf-8")
if curitem is None:
curitem = ""
else:
elif filternum == 2:
append(curitem.replace("\\", "\\\\").replace("\n", "\\n").replace('"', '\\"'))
elif filternum == 3:
- append( escape_xml( curitem.replace("\x19", "").replace("\x1c", "").replace("\x1e", "").replace('\xc2\x86', '').replace('\xc2\x87', '') ))
+ append( escape_xml( curitem ))
elif filternum == 4:
append(curitem.replace("%", "%25").replace("+", "%2B").replace('&', '%26').replace('?', '%3f').replace(' ', '+'))
elif filternum == 5:
self.res.append('<?' + target + ' ' + data + '>')
def characters(self, ch):
- ch = ch.encode('utf-8', 'ignore')
+ ch = ch.encode('utf-8')
if self.mode == 0:
self.res.append(ch)
elif self.mode == 2: