[stdlib] UnicodeEncoding: hide/internalize APIs we're not sure about

The best high-level APIs for decoding/transcoding are still under active
investigation.  It's likely we want more views.  Therefore, leave
de-underscored/public only the lowest-level APIs for now.
This commit is contained in:
Dave Abrahams
2017-05-09 10:17:42 -07:00
parent 37ed4e56f4
commit e7b32f9dc9
11 changed files with 69 additions and 75 deletions

View File

@@ -381,15 +381,15 @@ public struct _StringCore {
else {
// TODO: be sure tests exercise this code path.
for b in bytes {
Encoding.encode(
Encoding._encode(
UnicodeScalar(_unchecked: UInt32(b))).forEach(processCodeUnit)
}
}
}
else if let content = _unmanagedUTF16 {
var i = content.makeIterator()
_Unicode.UTF16.ForwardParser.parse(&i) {
Encoding.transcode($0, from: UTF16.self).forEach(processCodeUnit)
_Unicode.UTF16.ForwardParser._parse(&i) {
Encoding._transcode($0, from: UTF16.self).forEach(processCodeUnit)
}
}
else if hasCocoaBuffer {