Skip to content

Conversation

@spevans
Copy link
Contributor

@spevans spevans commented May 27, 2018

NSString(contentsOf:usedEncoding:) would only test for UTF16 and UTF32 before falling back to UTF8. Using the char-set from the Content-Type header if available allows the specified encoding to be tried.

This matches the behaviour on Darwin for non-file URLs.

@spevans
Copy link
Contributor Author

spevans commented May 27, 2018

@swift-ci please test

Copy link
Contributor

@parkera parkera left a comment

Choose a reason for hiding this comment

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

Nice!

@spevans
Copy link
Contributor Author

spevans commented May 29, 2018

@swift-ci please test and merge

@swift-ci swift-ci merged commit 9ecb4fa into swiftlang:master May 29, 2018
@sergeydi
Copy link

sergeydi commented Jun 7, 2018

Hi,
In what release this fix will be?

@parkera
Copy link
Contributor

parkera commented Jun 14, 2018

This looks lined up for Swift 5.0. We'll need to cherry-pick to the swift-4.2-branch to make sure it lands there.

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.

4 participants