return ord(self.value)
def calculate_result_code(self):
- return "'%s'" % StringEncoding.escape_character(self.value)
+ return "'%s'" % StringEncoding.escape_char(self.value)
class IntNode(ConstNode):
self.chars.append(characters)
def append_charval(self, char_number):
- self.chars.append( chr(char_number) )
+ self.chars.append( chr(char_number).encode('ISO-8859-1') )
def getstring(self):
# this *must* return a byte string! => fix it in Py3k!!
_has_specials = _build_specials_test()
-def escape_character(c):
+def escape_char(c):
+ c = c.decode('ISO-8859-1')
if c in '\n\r\t\\':
return repr(c)[1:-1]
elif c == "'":