We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
md5: 8dfc9af638c0545d5e232c1909733399
Issue Description:
String.Index.encodedOffset doesn't necessarily mean UTF16 offset.
String.Index.encodedOffset
In Swift4.2 on macOS, '"こんにちは".endIndex.encodedOffset' results 5, but in the current master, it's 15 probably because swiftlang/swift#20315 .
"こんにちは".endIndex.encodedOffset
5
15
Moreover, if the string is backed by NSString it's 5 even in Swift5.
NSString
let str: String = "こんにちは" print(str.endIndex.encodedOffset) // 15 import Foundation let nsStr: NSString = "こんにちは" let _nsStr = nsStr as String print(_nsStr.endIndex.encodedOffset) // 5
The text was updated successfully, but these errors were encountered:
CC: @benlangmuir
Sorry, something went wrong.
#14
No branches or pull requests
Additional Detail from JIRA
md5: 8dfc9af638c0545d5e232c1909733399
Issue Description:
String.Index.encodedOffset
doesn't necessarily mean UTF16 offset.In Swift4.2 on macOS, '
"こんにちは".endIndex.encodedOffset
' results5
, but in the current master, it's15
probably because swiftlang/swift#20315 .Moreover, if the string is backed by
NSString
it's5
even in Swift5.The text was updated successfully, but these errors were encountered: