leafo / lapis

A web framework for Lua and OpenResty written in MoonScript
http://leafo.net/lapis/
MIT License
3.14k stars 247 forks source link

Unicode characters rendered wrongly #704

Closed ghoomfrog closed 4 years ago

ghoomfrog commented 4 years ago

"©" => "©" "•" => "•"

leafo commented 4 years ago

You didn't set the content type on your HTML document you output.

The default layout includes an HTML tag with utf-8 content type

ghoomfrog commented 4 years ago

@leafo I did meta charset: 'UTF-8' and meta http-equiv: 'content-type', content: 'text/html; charset=UTF-8', but it still didn't work.

leafo commented 4 years ago

I recommend reading the HTML output via the view-source tool in your browser to ensure what you think you're outputting is showing up. It's likely you made a mistake somewhere since even the snippet you shared has a syntax error: meta http-equiv: 'content-type'

There's also a rare chance that your editor has written out those characters encoded in something other than UTF-8, but I think it's more likely that you haven't set the content type on the html document correctly.

ghoomfrog commented 4 years ago

@leafo oops, I meant 'http-equiv'. It's because I didn't copy-paste my code.

ghoomfrog commented 4 years ago

@leafo Bruh. I forgot to compile a moon file. Gosh darn it! meta charset: 'UTF-8' did the job.