From 0afa304f523f5674c5c44098c8c4fe06ba340af7 Mon Sep 17 00:00:00 2001 From: tomkat83 Date: Mon, 7 Mar 2016 09:47:30 +0100 Subject: [PATCH] utils.Window to return unicode in all cases --- resources/lib/utils.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/resources/lib/utils.py b/resources/lib/utils.py index 3f7257a9..f539545f 100644 --- a/resources/lib/utils.py +++ b/resources/lib/utils.py @@ -207,18 +207,21 @@ def window(property, value=None, clear=False, windowid=10000): if clear: WINDOW.clearProperty(property) elif value is not None: + # Takes unicode or string by default! WINDOW.setProperty(property, value) else: #getproperty returns string so convert to unicode - return WINDOW.getProperty(property)#.decode("utf-8") + return unicode(WINDOW.getProperty(property)) def settings(setting, value=None): # Get or add addon setting addon = xbmcaddon.Addon(id='plugin.video.plexkodiconnect') if value is not None: + # Takes string or unicode by default! addon.setSetting(setting, value) else: - return addon.getSetting(setting) #returns unicode object + # Returns unicode by default! + return addon.getSetting(setting) def language(stringid): # Central string retrieval