-
Notifications
You must be signed in to change notification settings - Fork 226
New issue
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
Non-ASCII characters in Objective-C produce incorrect output #114
Comments
I’m pretty sure realm/jazzy#370 has the same root cause: that Clang is reporting byte offsets into the file. |
1ec5
changed the title
Marked sections go missing when too many non-ASCII characters appear in Objective-C comment blocks
Non-ASCII characters in Objective-C produce incorrect output
Dec 8, 2015
Hi @1ec5, yes we recently fixed a similar issue in SwiftLint: realm/SwiftLint#247 We should do a thorough review of all code in SourceKitten that deals with byte offsets to use |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If I run
sourcekitten doc --objc MGLMapView.h -x objective-c -isysroot $(xcrun --show-sdk-path) -I $(pwd)
with the following (stripped-down) contents of MGLMapView.h, I get the output I expect:However, if I add one more Unicode character (such as
’
or≠
) to the MGLMapView class’s documentation comment,#pragma mark
sections go missing and character indices get knocked out of place:As far as I can tell, the issue seems to be that
String.pragmaMarks(_:excludeRanges:limitRange:)
in String+SourceKitten.swift works with NSString indices, whereasclang_getSpellingLocation()
appears to be reporting byte offsets./cc @friedbunny
The text was updated successfully, but these errors were encountered: