mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
don't call into CoreFoundation to perform UTF-8 transcoding. CoreFoundation can replace ill-formed sequences with a single byte, which is not good enough to implement U+FFFD insertion. Instead, use the same transcoding routine as for contiguous buffer. Pulled out the transcoding routine into a generic function that should be specialized and simplified for the case when input is UnsafeArray; we should not be losing efficiency here. Fixes <rdar://problem/17297055> [unicode] println crashes when given string with unpaired surrogate Swift SVN r19157
5.0 KiB
5.0 KiB