Skip to content

Commit

Permalink
Correctly handle UTF-8 encoding .ly file. Solve issue aspiers#58
Browse files Browse the repository at this point in the history
  • Loading branch information
thawk committed Jan 18, 2020
1 parent 2852872 commit 1a7f2ff
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ly2video/ly/tokenize.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ class Token(unicode):
"""
def __new__(cls, matchObj, tokenizer):
obj = unicode.__new__(cls, matchObj.group())
obj = unicode.__new__(cls, matchObj.group(), "utf-8")
obj.pos, obj.end = matchObj.span()
return obj

Expand Down Expand Up @@ -293,7 +293,7 @@ class Unparsed(Token):
"""
def __new__(cls, value, pos):
obj = unicode.__new__(cls, value)
obj = unicode.__new__(cls, value, "utf-8")
obj.pos = pos
obj.end = pos + len(obj)
return obj
Expand Down

0 comments on commit 1a7f2ff

Please sign in to comment.