Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Archive

Set encoding to UTF-8

Started by Muut Archive 11 years ago · 11 replies · 1528 views
11 years ago

Hi all,
I noticed some problems with german umlaute (ä, ö, ü, ß). They are not displayed correct. Even worse, these umlaute seem to some kind of crash the interpreting because also the page properties (title etc.) are not interpreted but shown on the page... In thread Problems with vowel mutations I've found the solution. I've added AddDefaultCharset utf-8 add the bottom of .htaccess of root path but it did not fix the problem. So I've set the encoding in my Notepad++ to 'Encoding in UTF-8 without BOM' because setting 'Encoding in UTF-8' did not fix the problem. So now it's displayed fine, but I'm very sure I will forget to change it to this setting every time I create a new file. And it's also difficult to explain to other editors :-(
Is it somehow possible to set the encoding to UTF-8 by default so it does not matter which encoding is set in the editor?

11 years ago

Can you try putting this in your HTML header:

TXT
<meta charset="utf-8">

Does that help?

11 years ago

BTW, this is something that is already set in the Antimatter theme in the templates/partials/base.html.twig file. Other than that, you do need to set UTF-8 as your default encoding type in your editor if you are using UTF-8 characters in your text. I suggest using Sublime Text Editor as I'm pretty sure it defaults to this.

11 years ago

Oh no, that would be really bad :-( I'm importing files from another source, and there I could set encoding to 'UTF8', but as already said with Notepad++ at the first post, 'UTF8' does not fix the problem. In Notedpad++ I have to select 'utf8 without BOM' (whatever this means). But this option does not appear there :-( Is there no way to 'hardcode' UTF8?

11 years ago

OK, Managed to build them using UTF8 without BOM. Thanks rhukster!

11 years ago

Hi Kai, i have the same Problem with German umlaut (ä,ö,ü,ß). How have you solved the problem? The files are all in UTF8 but it will not display correctly? Utf_file

11 years ago

hi
Use UTF-8 folder name, this page is 404 error.
Collection of this page(this URL is non-UTF-8) display correct.
I'm using GRAV0.9.35 with stripe site.

11 years ago

folder names need to be valid slugs.. so no special characters.

11 years ago

Sorry, I didn't know that.
I was using UTF-8 URLs in old version (Grav 0.9.9).
thx.

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1279 9 years ago
Archive · by Muut Archive, 9 years ago
2 886 9 years ago
Archive · by Muut Archive, 9 years ago
2 4015 9 years ago
Archive · by Muut Archive, 9 years ago
1 2891 9 years ago
Archive · by Muut Archive, 9 years ago
3 1075 9 years ago