mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[stdlib] Rebuild String.Index for UTF8View
This commit is contained in:
@@ -78,6 +78,7 @@ extension _UnicodeEncoding_ {
|
||||
/// Converts from encoding-independent to encoded representation, returning
|
||||
/// `encodedReplacementCharacter` if the scalar can't be represented in this
|
||||
/// encoding.
|
||||
@_versioned
|
||||
internal static func _encode(_ content: Unicode.Scalar) -> EncodedScalar {
|
||||
return encode(content) ?? encodedReplacementCharacter
|
||||
}
|
||||
@@ -85,6 +86,7 @@ extension _UnicodeEncoding_ {
|
||||
/// Converts a scalar from another encoding's representation, returning
|
||||
/// `encodedReplacementCharacter` if the scalar can't be represented in this
|
||||
/// encoding.
|
||||
@_versioned
|
||||
internal static func _transcode<FromEncoding : Unicode.Encoding>(
|
||||
_ content: FromEncoding.EncodedScalar, from _: FromEncoding.Type
|
||||
) -> EncodedScalar {
|
||||
@@ -92,6 +94,7 @@ extension _UnicodeEncoding_ {
|
||||
?? encodedReplacementCharacter
|
||||
}
|
||||
|
||||
@_versioned
|
||||
internal static func _transcode<
|
||||
Source: Sequence, SourceEncoding: Unicode.Encoding>(
|
||||
_ source: Source,
|
||||
|
||||
Reference in New Issue
Block a user