-->
Page 1 of 1

Simple LUA WebServer UTF-8 Problem

PostPosted: Mon Feb 02, 2015 3:59 pm
by ozayturay
Code: Select allsrv = net.createServer(net.TCP)
srv:listen(80, function(conn)
  conn:on("receive", function(client)
    client:send('<html><head><title>ESP8266</title>')
    client:send('<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />')
    client:send('</head><body>çöşığüÇÖŞİĞÜ</body></html>')
    client:close()
    collectgarbage()
  end)
end)


I simplified the code down to this and replicated the problem. The HTML code is served as ANSI (I use NotePad++ for source viewer in IE and it shows ANSI) instead of UTF-8 by the lua server, so I cannot display characters specific to my locale. What can I do to make lua serve pages as UTF-8?

Re: Simple LUA WebServer UTF-8 Problem

PostPosted: Tue Feb 03, 2015 9:49 am
by ozayturay
I temporarily solve my problem by using ISO-8859-9 instead of UTF-8 as charset, but using UTF-8 will be much better. Any ideas?