Re: Encoding of Swift string literals?
Re: Encoding of Swift string literals?
- Subject: Re: Encoding of Swift string literals?
- From: Jens Alfke <email@hidden>
- Date: Thu, 07 Jul 2016 23:11:00 -0700
> On Jul 7, 2016, at 6:16 PM, William Squires <email@hidden> wrote:
>
> Is it NSASCIIStringEncoding, or UTF8 (or something else)? Is it dependent on the system locale or language setting? (in my case, locale is US, and language is US English, with a US keyboard).
I think you’re asking about what string encoding is used to parse Swift source files. (String literals aren’t the only place non-ASCII characters can appear, since any identifier can contain them.) Pretty sure the answer is simply “UTF-8”.
> Also, do string literals in Swift still respect the '\' escape sequences, like in C?
Pretty certain the Swift book answers this — it’s got the whole language grammar in it — and pretty certain the answer is “yes”, but I don’t have time to look it up right now. Did you check?
—Jens
PS: Swift language questions, unrelated to Cocoa APIs, are best asked on the Swift mailing list: https://lists.swift.org/mailman/listinfo/swift-users
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden