# this will be a unicode string in Py3, so make sure we can decode it
ifnotself.is_identifier:
encoding=self.value.encodingor'UTF-8'
try:
self.value.decode(encoding)
exceptUnicodeDecodeError:
error(self.pos,"String decoding as '%s' failed. Consider using a byte string or unicode string explicitly, or adjust the source code encoding."%encoding)