We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4ad8b26 commit e821269Copy full SHA for e821269
stdlib/public/core/StringGuts.swift
@@ -417,7 +417,9 @@ extension _StringGuts {
417
// FIXME: Consider performing a linked-on-or-after check & trapping if the
418
// client executable was built on some particular future Swift release.
419
let utf16 = String(self).utf16
420
- return utf16.index(utf16.startIndex, offsetBy: i._encodedOffset)
+ let base = utf16.index(utf16.startIndex, offsetBy: i._encodedOffset)
421
+ if i.transcodedOffset == 0 { return base }
422
+ return base.encoded(offsetBy: i.transcodedOffset)._knownUTF8
423
}
424
425
0 commit comments