中文转 utf-8:
display.addingPercentEncoding(withAllowedCharacters: .urlFragmentAllowed)
utf-8转中文:
display.removingPercentEncoding (ios10.0之后)
display.replacingPercentEscapes(using: .utf8) (ios10.0之前)
中文转 utf-8:
display.addingPercentEncoding(withAllowedCharacters: .urlFragmentAllowed)
utf-8转中文:
display.removingPercentEncoding (ios10.0之后)
display.replacingPercentEscapes(using: .utf8) (ios10.0之前)
本文标题:Swift 中的中文与utf-8编码相互转换
本文链接:https://www.haomeiwen.com/subject/gpnzkxtx.html
网友评论