PercentEncoder icon indicating copy to clipboard operation
PercentEncoder copied to clipboard

Nice library, but maybe there is a little error in ReadMe

Open zhujinlong opened this issue 10 years ago • 0 comments

Nice library, but maybe there is a little error in ReadMe

NSString.stringByAddingPercentEncodingWithAllowedCharacters() is introduced from iOS 7. However it won't work in multi-byte languages like Japanes, Chinese, etc and an app crashes as shown at the issue in Alamorefire.

Actually,

"东京".stringByAddingPercentEncodingWithAllowedCharacters(NSCharacterSet.URLQueryAllowedCharacterSet())

will return "%E4%B8%9C%E4%BA%AC", this is the correct url encoded string.

stringByAddingPercentEncodingWithAllowedCharacters() maybe has memory issues, but i think it can work with multi-byte languages like Japanes, Chinese, etc.

zhujinlong avatar Jan 19 '16 09:01 zhujinlong