identifiers are encoded strings
authorStefan Behnel <scoder@users.berlios.de>
Tue, 13 May 2008 09:32:00 +0000 (11:32 +0200)
committerStefan Behnel <scoder@users.berlios.de>
Tue, 13 May 2008 09:32:00 +0000 (11:32 +0200)
Cython/Compiler/Scanning.py

index 278b8a7337563144dd05dbc04e25f7ab6e21fc06..67016d99032230c99b7b66b79ce452e7eddf2820 100644 (file)
@@ -11,7 +11,7 @@ import stat
 import sys
 from time import time
 
-from Cython import Plex
+from Cython import Plex, Utils
 from Cython.Plex import Scanner
 from Cython.Plex.Errors import UnrecognizedInput
 from Errors import CompileError, error
@@ -320,8 +320,12 @@ class PyrexScanner(Scanner):
             sy, systring = self.read()
         except UnrecognizedInput:
             self.error("Unrecognized character")
-        if sy == 'IDENT' and systring in self.resword_dict:
-            sy = systring
+        if sy == 'IDENT':
+            if systring in self.resword_dict:
+                sy = systring
+            else:
+                systring = Utils.EncodedString(systring)
+                systring.encoding = self.source_encoding
         self.sy = sy
         self.systring = systring
         if debug_scanner: