PDA

View Full Version : Does anybody know if it's possible to get http.request to read UTF-8?



Mastiff
January 23rd, 2017, 06:20 AM
If I do http.request on a page (any page, no matter if it's pure HTML or Javascript) that has the Norwegian special characters, like , or accented characters, like , it will answer with ø and similar. I can of course use string.gsub to replace them, but it would be nice if I didn't have to. So is there a way to get this working right?

An example:


print(http.request('http://www.urbandictionary.com/define.php?term=%C3%86%20%C3%98%20%C3%85'))

This will give you a full page, but somewhere down there you'll find this:


<meta content='† ˜ …' name='twitter:title'>



Thils should have been