[swift-dev] utf-8 issues in gyb and line-directive
Ryan Lovelett
swift-dev at ryan.lovelett.me
Tue Jan 12 13:31:06 CST 2016
I'm thought this was resolved in master already. Are you running the
latest version of master?
See
https://github.com/apple/swift/commit/97b98b193d1490685a0aaba78cccb76e2caba4c1
On Tue, Jan 12, 2016, at 01:12 PM, Lukas Stabe via swift-dev wrote:
> 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.
>
> — Lukas
> _______________________________________________
> swift-dev mailing list
> swift-dev at swift.org
> https://lists.swift.org/mailman/listinfo/swift-dev
> Email had 1 attachment:
> + signature.asc
> 1k (application/pgp-signature)
More information about the swift-dev
mailing list