[swift-evolution] Trial balloon: Ensure that String always contains valid Unicode

Javier Soto javier.api at gmail.com
Sat Dec 19 13:17:22 CST 2015

Right, I totally agree with you, but NSString compatibility would be
problematic then:
let s: NSString
let s2 = s as String // this would have to be a failable cast
On Sat, Dec 19, 2015 at 9:57 AM Guillaume Lessard via swift-evolution <
swift-evolution at swift.org> wrote:

> > On 18 déc. 2015, at 14:47, Paul Cantrell via swift-evolution <
> swift-evolution at swift.org> wrote:
> >
> > I was quite surprised to learn that it’s possible to create Swift
> strings that do not contain things other than valid Unicode characters. Is
> it feasible to guarantee that this cannot happen?
> That would be nice. I’m not sure that CFString or NSString guarantee
> correctness, though. If they don’t, then this could not be.
> Guillaume Lessard
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution
Javier Soto
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20151219/f1a675c4/attachment.html>

More information about the swift-evolution mailing list