fix identifier decoding check
authorStefan Behnel <scoder@users.berlios.de>
Sat, 24 Oct 2009 13:43:24 +0000 (15:43 +0200)
committerStefan Behnel <scoder@users.berlios.de>
Sat, 24 Oct 2009 13:43:24 +0000 (15:43 +0200)
Cython/Compiler/ExprNodes.py

index 8130a56eebdfbb4ec5642ebdb37e15ce5a0924c9..863e54ba9866b048b46c7cb8b3ba63a325c04c10 100644 (file)
@@ -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: