与Xcode 8随字符串实例方法removingPercentEncoding
附带的版本相比,我看到了Swift 3的开源版本的不一致行为。
let testString = "valid àæ"
let escapedString = testString.removingPercentEncoding
在Xcode中,escapedString
的结果是"valid àæ"
。但是,Swift的开源版本返回"valid à"
(缺少æ
)。
在网上试试。
我遗漏了什么?
发布于 2016-11-08 20:49:46
这是由于CFStringGetLength
会返回非拉丁字符的不正确值的错误。_CFStringCreateByAddingPercentEncodingWithAllowedCharacters
和_CFStringCreateByRemovingPercentEncoding
现在都修好了。
https://stackoverflow.com/questions/40268103
复制相似问题