Permalink
Browse files

Encode characters to utf-8 int the C string evaluator.

Our policy is not to deal with unicode() instances.

For some reason, this fixes a bug that showed up in the "OVM" app
bundle, but not the dev build running CPython.  There was a LookupError
saying the ascii codec wasn't found.
  • Loading branch information...
Andy Chu
Andy Chu committed Jan 12, 2018
1 parent e956abe commit 04f743617004148f221c1b5a913b8d869140ef75
Showing with 1 addition and 1 deletion.
  1. +1 −1 core/word_compile.py
View
@@ -70,7 +70,7 @@ def EvalCStringToken(id_, value):
elif id_ in (Id.Char_Unicode4, Id.Char_Unicode8):
s = value[2:]
i = int(s, 16)
return unichr(i)
return unichr(i).encode('utf-8') # Stay in the realm of bytes
else:
raise AssertionError

0 comments on commit 04f7436

Please sign in to comment.