Commit 11955ff6 authored by Stefan Behnel's avatar Stefan Behnel

make sure header filenames pass literally into the C code

parent 16ac5bf9
......@@ -591,7 +591,8 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
def generate_includes(self, env, cimported_modules, code):
includes = []
for filename in env.include_files:
code.putln('#include "%s"' % filename)
# fake decoding of filenames to their original byte sequence
code.putln('#include "%s"' % filename.as_unicode())
def generate_filename_table(self, code):
code.putln("")
......
......@@ -89,6 +89,12 @@ class BytesLiteral(_bytes):
def utf8encode(self):
assert False, "this is not a unicode string: %r" % self
def as_unicode(self):
"""Returns a Unicode sequence that matches the byte sequence
of this literal.
"""
return self.decode('ISO-8859-1')
is_unicode = False
char_from_escape_sequence = {
......
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