diff options
author | mnandri <mnandri@eumnandri.fritz.box> | 2015-12-19 19:30:12 +0100 |
---|---|---|
committer | mnandri <mnandri@eumnandri.fritz.box> | 2015-12-19 19:30:12 +0100 |
commit | 499d2b55e99fa2021166e38753e81df9d40dac1f (patch) | |
tree | e94fc346b1250d8cc9a3131f4c37e3af2e113d25 /service/pixelated/support | |
parent | 8b61b34f1ed71c04afbeeb45f08a65d35a18423d (diff) |
moving custom to_unicode to pixelated.support
Diffstat (limited to 'service/pixelated/support')
-rw-r--r-- | service/pixelated/support/functional.py | 7 |
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 |