You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`String.addingPercentEncoding(withAllowedCharacters: CharacterSet)` produces incorrect output when the string contains certain Unicode characters. It does not seem to matter which CharacterSet is used.
This issue occurs on Ubuntu 16.04, but does NOT occur on macOS.
Tested on Swift 3.0.1 Release and swift-DEVELOPMENT-SNAPSHOT-2016-11-12-a-ubuntu16.04.
Steps to reproduce:
```swift
import Foundation
let str = "CaféRio" // Accented "e"
let escaped = str.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed)!
print(escaped)
```
Expected output: Caf%C3%A9Rio
Actual output: Caf%C3%A9Ri
Notice that the actual Unicode character is escaped correctly, but the resulting string is missing a character at the end. For each "é" inside the string, another trailing character goes missing.
The text was updated successfully, but these errors were encountered:
This issue could have been fixed in #706
While I get expected result (Caf%C3%A9Rio) with this fix, reverting the fix, gives me incorrect result (Caf%C3%A9Ri) for 'CaféRio'.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed).
But I'm not sure if this changes was included in snapshot.
collinhundley (JIRA User) Look like the issue is resolved now .I have tested with latest snapshot swift-DEVELOPMENT-SNAPSHOT-2017-03-09-a-ubuntu16.04 and swift-3.1-DEVELOPMENT-SNAPSHOT-2017-02-19-a-ubuntu16.04.Please verify and close the issue
Additional Detail from JIRA
md5: 2ce68f79cd1be82026c5ff96042bcc1f
Issue Description:
`String.addingPercentEncoding(withAllowedCharacters: CharacterSet)` produces incorrect output when the string contains certain Unicode characters. It does not seem to matter which CharacterSet is used.
This issue occurs on Ubuntu 16.04, but does NOT occur on macOS.
Tested on Swift 3.0.1 Release and swift-DEVELOPMENT-SNAPSHOT-2016-11-12-a-ubuntu16.04.
Steps to reproduce:
```swift
import Foundation
let str = "CaféRio" // Accented "e"
let escaped = str.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed)!
print(escaped)
```
Expected output: Caf%C3%A9Rio
Actual output: Caf%C3%A9Ri
Notice that the actual Unicode character is escaped correctly, but the resulting string is missing a character at the end. For each "é" inside the string, another trailing character goes missing.
The text was updated successfully, but these errors were encountered: