Skip to content

Commit

Permalink
fix utils.py
Browse files Browse the repository at this point in the history
  • Loading branch information
taishi-i committed Jun 19, 2020
1 parent edf3427 commit bd03fbe
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions nagisa/utils.py
Expand Up @@ -35,7 +35,10 @@

def utf8rstrip(text):
if PY_3 is False:
return unicode(text.rstrip(), 'utf-8')
if type(text) is unicode:
None
else:
text = unicode(text, 'utf-8')
else:
return text.rstrip()

Expand All @@ -53,7 +56,10 @@ def preprocess(text):

def preprocess_without_rstrip(text):
if PY_3 is False:
text = unicode(text, 'utf-8')
if type(text) is unicode:
None
else:
text = unicode(text, 'utf-8')
text = normalize(text)
text = text.replace(' ', ' ')
return text
Expand Down

0 comments on commit bd03fbe

Please sign in to comment.