[swift-corelibs-dev] Build failure and differences between test and build

2017-06-21 Thread Alex Blewitt via swift-corelibs-dev
We had a test failure on swift-corelibs-foundation recently on master, which was related to this pull request being merged by me: https://github.com/apple/swift-corelibs-foundation/pull/1043 The automated tests passed, but after bei

[swift-corelibs-dev] Foundation: NSString init detect encoding

2017-06-21 Thread Andy Best via swift-corelibs-dev
Hey, I've been looking at the init(contentsOfFile, usedEncoding) initializer for NSString in corelibs-foundation. Am I right in thinking that this initializer should use some method to attempt to detect the character encoding of the file before returning a decoded String? If so, I've been workin

Re: [swift-corelibs-dev] Build failure and differences between test and build

2017-06-21 Thread Tony Parker via swift-corelibs-dev
> On Jun 21, 2017, at 6:30 AM, Alex Blewitt via swift-corelibs-dev > wrote: > > We had a test failure on swift-corelibs-foundation recently on master, which > was related to this pull request being merged by me: > > https://github.com/apple/swift-corelibs-foundation/pull/1043 >

[swift-corelibs-dev] Foundation: NSString init detect encoding

2017-06-21 Thread Andy Best via swift-corelibs-dev
Hey, I've been looking at the init(contentsOfFile, usedEncoding) initializer for NSString in corelibs-foundation. Am I right in thinking that this method should use some method to attempt to detect the character encoding of the file before returning a decoded String? If so, I've been working on

Re: [swift-corelibs-dev] Foundation: NSString init detect encoding

2017-06-21 Thread Tony Parker via swift-corelibs-dev
Hi Andy, > On Jun 21, 2017, at 7:39 AM, Andy Best via swift-corelibs-dev > wrote: > > Hey, > > I've been looking at the init(contentsOfFile, usedEncoding) initializer for > NSString in corelibs-foundation. > > Am I right in thinking that this method should use some method to attempt to > d

Re: [swift-corelibs-dev] Foundation: NSString init detect encoding

2017-06-21 Thread Tony Parker via swift-corelibs-dev
Our preferred approach so far is to mirror Foundation as closely as possible. I don’t know if we want to implement stringEncodingForData as part of swift-corelibs-foundation. In any case, we are trying to avoid bringing in as few dependencies outside of the Swift project itself as possible, to k

Re: [swift-corelibs-dev] Foundation: NSString init detect encoding

2017-06-21 Thread Tony Parker via swift-corelibs-dev
Someone on the team here just reminded me that we do have a very basic form of encoding detection here as well: just looking for the BOM at the beginning of the data. - Tony > On Jun 21, 2017, at 9:55 AM, Tony Parker via swift-corelibs-dev > wrote: > > Our preferred approach so far is to mir

Re: [swift-corelibs-dev] Foundation: NSString init detect encoding

2017-06-21 Thread Andy Best via swift-corelibs-dev
Is the preferred approach to mirror Foundation as closely as possible (e.g. under Linux basically do nothing), or is implementing something like stringEncodingForData under the hood preferable in this case? On 21 June 2017 at 17:43, Tony Parker wrote: > Hi Andy, > > > On Jun 21, 2017, at 7:39 AM