mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-31 01:38:08 -05:00
_force_unicode: Bail out early if text is already unicode.
This commit is contained in:
@@ -88,6 +88,9 @@ def _force_unicode(text):
|
||||
if text == None:
|
||||
return u''
|
||||
|
||||
if isinstance(text, unicode):
|
||||
return text
|
||||
|
||||
try:
|
||||
text = unicode(text, 'utf-8')
|
||||
except UnicodeDecodeError:
|
||||
|
||||
Reference in New Issue
Block a user