[swift-dev] utf-8 issues in gyb and line-directive
lukas at stabe.de
Tue Jan 12 12:12:33 CST 2016
I’ve tried to compile Swift in a clean Arch Linux chroot. In this environment, `sys.getdefaultencoding()` does not return `utf-8`, which causes gyb and line-directive to fail with non-ascii characters in input files.
One example of such a file is Arrays.swift.gyb, which contains a ≤-character [here](https://github.com/apple/swift/blob/master/stdlib/public/core/Arrays.swift.gyb#L358).
In gyb, `argparse.FileType` is used to open input files, and line-directive uses plain old `open(…)`. Sadly, both of those don’t provide functionality to specify the file encoding in Python 2.7.10, which is what OSX ships with.
I’m not that experienced in Python, so I don’t know what the pythonic way to solve this would be, so if anyone with more Python experience would help solve this, that would be great.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 841 bytes
Desc: Message signed with OpenPGP using GPGMail
More information about the swift-dev