After a bit more re-engineering, I removed the need to html encode the data. My question is now as follows:
I have a variable thats latin-1 encoded, e.g. montr\xe9al .
I want to convert that to montréal. I think I can use iconv, but using the iconv documentation, I'm not getting the expected output.
iconv = require("iconv") cd = iconv.new('latin1', 'utf8')
city = "montr\xe9al" nstr, err = cd:iconv(city)