标签: ruby-on-rails ruby utf-8
我有一个UTF-8字符串,如:
NA
并希望转换为a= "for ccps ‘the way forward’"
a= "for ccps ‘the way forward’"
我尝试过代码:
for CCPs ‘the way forward’
答案 0 :(得分:0)
终于得到了解决方案:
a= "for ccps ‘the way forward’" a.encode("cp1252").force_encoding("utf-8")