How do I set encoding via http header?

Hi, is it possible to set the encoding to UTF-8 for all sites via HTTP header?

Tuxifan

Hi, @niansa, yes, you can use custom headers to do this.

If you have other questions about this, please let us know.

The problem is that I would fixate the content-type by doing so since the encoding is set via the content-type header.

Hey @niansa,

Can you elaborate a little bit on your use case? Maybe then, we can home in on what a suitable course of action might be!

Instead of having to set the encoding via in every single of my HTML documents I’d like to have that done via headers that apply to all html documents.

Can’t you use some mechanism to template your site(s) and add this, like layouts in Jekyll?

I found out that I can add the encoding meta as a snippet, so it gets used on all sites.

1 Like