标签: ruby-on-rails ruby string character
字符串是:
"Hugo S%C3%A1nchez"
当我尝试解码时,它显示为:
irb(main):016:0> CGI.escapeHTML('Hugo S%C3%A1nchez') => "Hugo S%C3%A1nchez"
我应该如何使它看起来像Hugo Sánchez?
Hugo Sánchez
答案 0 :(得分:1)
使用CGI.unescape:
CGI.unescape "Hugo S%C3%A1nchez" # => "Hugo S\u00E1nchez"