我想unescape "Sch%C3%B6ne"
。我发现这个unescape
在线功能在很多情况下有效,但不是这个,因为它是一个2个字符,我在http://www.lua.org/cgi-bin/demo上测试了以下代码
teststring = "Sch%C3%B6ne"
function unescape (str)
str = string.gsub (str, "+", " ")
str = string.gsub (str, "%%(%x%x)", function(h) return string.char(tonumber(h,16)) end)
str = string.gsub (str, "\r\n", "\n")
return str
end
print(unescape(teststring))
它打印Schöne
,但我想要Schöne
。任何人都可以帮助我吗?