mirror of
https://github.com/jlengrand/twitterboard.git
synced 2026-03-10 08:51:22 +00:00
Has to reencode before saving to db and so. Already decodes hashtags. Lets now decode tweets
16 lines
356 B
Python
16 lines
356 B
Python
# -*- coding: utf-8 -*-
|
|
|
|
|
|
class EncodingUtils():
|
|
def __init__(self):
|
|
pass
|
|
|
|
def to_unicode(self, obj, encoding='utf-8'):
|
|
"""
|
|
Returns an encoded string into unicode
|
|
"""
|
|
if isinstance(obj, basestring):
|
|
if not isinstance(obj, unicode):
|
|
obj = unicode(obj, encoding)
|
|
|
|
return obj |