\"渣打\\351\\223\\266\"" />
开发者

issue with CGI::unescapeHTML

开发者 https://www.devze.com 2023-01-24 18:01 出处:网络
CGI::unescapeHTML(\"&a开发者_开发知识库mp;#28195;打银\") => \"渣打\\351\\223\\266\"
CGI::unescapeHTML("&a开发者_开发知识库mp;#28195;打银")

=> "渣打\351\223\266"

CGI::unescapeHTML("渣打银 ")

=> "渣打银 "

Adding a space at the end makes the difference, else the last character is lost and I get this strange character sequence. I am facing this very issue when I try to scrape data form websites using utf-8 character encoding. This is true even for normal english text.


This is not a problem with the CGI library that comes with Ruby 1.9.2 and above.


Run your ruby interpreter with -Ku

0

精彩评论

暂无评论...
验证码 换一张
取 消