summaryrefslogtreecommitdiff
path: root/service/pixelated/support/functional.py
diff options
context:
space:
mode:
Diffstat (limited to 'service/pixelated/support/functional.py')
-rw-r--r--service/pixelated/support/functional.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/service/pixelated/support/functional.py b/service/pixelated/support/functional.py
index b496eb95..2e293625 100644
--- a/service/pixelated/support/functional.py
+++ b/service/pixelated/support/functional.py
@@ -28,3 +28,10 @@ def unique(_list):
def compact(_list):
return [a for a in _list if a]
+
+
+def to_unicode(text):
+ if text and not isinstance(text, unicode):
+ encoding = 'utf-8'
+ return unicode(text, encoding=encoding)
+ return text