[swift-evolution] [Pitch] String revision proposal #1

Brent Royal-Gordon brent at architechies.com
Wed Apr 5 18:16:07 CDT 2017


> On Apr 5, 2017, at 12:16 PM, Ben Cohen <ben_cohen at apple.com> wrote:
> 
> The idea is, if you don’t want to make repairs, you use the transcoding primitives instead. The belief is that the old non-repairing versions (return nil if repairs needed) weren’t useful.

Yes—I was asking about the transcoding primitives here. Currently the call looks like one of these:

	let (remainder, errorCount) = UTF8.parseForward(bytes, repairingIllFormedSequences: false) { … }
	let (remainder, errorCount) = UTF8.parseForward(bytes, repairingIllFormedSequences: true) { … }

I'm saying, would it be clearer if it looked like this instead?

	let (remainder, errorCount) = UTF8.parseForward(bytes, ifIllFormed: .stop) { … }
	let (remainder, errorCount) = UTF8.parseForward(bytes, ifIllFormed: .repair) { … }

-- 
Brent Royal-Gordon
Architechies

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20170405/bdfcdf1a/attachment.html>


More information about the swift-evolution mailing list