我有一个UTF-8字符串,例如:
a= "for ccps ‘the way forward’"
并想要转换为 for CCPs ‘the way forward’
我尝试了类似的代码:
CGI.escape a
终于得到了解决方案:
a= "for ccps ‘the way forward’"
a.encode("cp1252").force_encoding("utf-8")
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句