From 499d2b55e99fa2021166e38753e81df9d40dac1f Mon Sep 17 00:00:00 2001 From: mnandri Date: Sat, 19 Dec 2015 19:30:12 +0100 Subject: moving custom to_unicode to pixelated.support --- service/pixelated/support/functional.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'service/pixelated/support/functional.py') 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 -- cgit v1.2.3