Skip to content

Conversation

@lxbndr
Copy link
Contributor

@lxbndr lxbndr commented Jul 13, 2024

As the String.withCString function provides utf-8 encoded content, we should not use String.count for receiving buffer length. NSURL.fileSystemRepresentation is used in FileHandle(forReadingFrom:), and it fails with file urls containing non-ascii (e.g. cyrillic) characters.

@lxbndr
Copy link
Contributor Author

lxbndr commented Jul 13, 2024

cc @compnerd

@jmschonfeld
Copy link
Contributor

@swift-ci please test Linux platform

@jmschonfeld
Copy link
Contributor

@swift-ci please test Windows platform

Copy link
Contributor

@jmschonfeld jmschonfeld left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me!

@parkera parkera merged commit 8c68478 into swiftlang:main Jul 16, 2024
@lxbndr lxbndr deleted the win-url-fsr-utf8 branch July 17, 2024 21:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants