Pelican: Issues with special chars like “, ” and ´

Created on 26 Sep 2019  Â·  8Comments  Â·  Source: getpelican/pelican

If the blog article contains some special chars, the output on the website looks weird.

“social” networks becomes “social” networks
don´t and aren´t becomes don´t and aren´t

But
"social" stays "social"
don't stays don't

I am using Pelican 4.1.2

All 8 comments

I can't reproduce your issue. How are you encoding the files? Maybe this post can help you: HowTo: Check and Change File Encoding In Linux.

If you have enabled Typogrify, perhaps try disabling it. If that doesn't resolve the issue, please consider reaching out via the Pelican IRC channel, as noted in the How to Get Help section of the documentation. Thanks!

@jorgesumle Do the special signs really show up like they should on your website?

The files are all text/plain; charset=utf-8 and the signs show up like they should in vim.

It could be the other way around. Your web server might be posting an UTF-8 file as LATIN-1 (or something like that). Check the Content-Type: header you get.

Ok, that sounds plausible, because the files in the output directory look good after generating with pelican content But on the website (localhost:8000) with pelican --listen the signs are screw up again. How can I configure the buildin server to show it as UTF-8?

Ok, I figured out that everything is "okay". At least it works somehow and confuses me more.

I've uploaded the output dir to a webserver and I still got the weird chars (I use FreeBSD and Firefox). But after checking the same site with my Android device, the signs were ok. But checking the same site with an iPhone it showed the signs screws up again.

I am out of my knowledge, because I don´t even know what it could go wrong there???

I think python server, the one used in pelican --listen, takes encoding from system locale.

For webserver, well, it depends on the webserver unsurprisingly.

One thing that could help is including charset meta tag. Check your theme and add it if it is not there:

<meta charset="UTF-8">

Putting <meta charset="UTF-8"> in the header of base.html of the theme solved this problem.

Thanks a lot.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

karlcow picture karlcow  Â·  5Comments

rpmzandwijk picture rpmzandwijk  Â·  3Comments

mandaris picture mandaris  Â·  4Comments

Lucas-C picture Lucas-C  Â·  4Comments

networkpadawan picture networkpadawan  Â·  3Comments