Commit 20de226f authored by Stefan Behnel's avatar Stefan Behnel

fix identifier decoding check

parent e13327cb
......@@ -926,8 +926,8 @@ class StringNode(PyConstNode):
self.check_for_coercion_error(dst_type, fail=True)
# this will be a unicode string in Py3, so make sure we can decode it
if not self.is_identifier:
encoding = self.value.encoding or 'UTF-8'
if self.value.encoding:
encoding = self.value.encoding
try:
self.value.decode(encoding)
except UnicodeDecodeError:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment