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
SR-1204 Truncated result of stringByAddingPercentEncodingWithAllowedCharacters
Issue Description:
Foundation methods .removingPercentEncoding and .addingPercentEncoding on Linux(Ubuntu) do not work the same as they do on MacOS, when using non latin unicode symbols.
Example code for .removingPercentEncoding:
import Foundation
let cyrillicString = "\u{0434}\u{043E}\u{043C}"
//returns "дом"
let cyrillicEscapedString = cyrillicString.removingPercentEncoding
//returns "д\u{ef}" on Linux. On MacOS returns "дом" i.e. same string which is expected
let chineseString = "\u{623F}\u{5B50}"
//returns "房子"
let chineseEscapedString = chineseString.removingPercentEncoding
//returns "\u{ef}" on Linux. For MacOS result is same as chineseString
let arabicString = "\u{0645}\u{0646}\u{0632}\u{0644}"
//returns "منزل"
let arabicEscapedString = arabicString.removingPercentEncoding
//return "من" on Linux
let randomString = "\u{00E0}\u{00E6}"
//returns "àæ"
let randomEscapedString = randomString.removingPercentEncoding
//returns "à" on Linux
let latinString = "home"
//returns "home"
let latinEscapedString = latinString.removingPercentEncoding
//returns "home"
Example code for . addingPercentEncoding:
import Foundation
let string = "\u{0434}\u{043E}\u{043C}"//returns "дом"
let escaped = string.addingPercentEncoding(withAllowedCharacters: .alphanumerics)
//returns "%D0%B4%D0", while it should return "%D0%B4%D0%BE%D0%BC"
The text was updated successfully, but these errors were encountered:
Environment
OS: Ubuntu 14.04.
Swift 10.25 snapshot
Additional Detail from JIRA
md5: 06a43e5ed7d9e1fe8beff900625f8600
is duplicated by:
Issue Description:
Foundation methods .removingPercentEncoding and .addingPercentEncoding on Linux(Ubuntu) do not work the same as they do on MacOS, when using non latin unicode symbols.
Example code for .removingPercentEncoding:
Example code for . addingPercentEncoding:
The text was updated successfully, but these errors were encountered: