Yaml: invalid trailing UTF-8 octet

hi guys
I updated Hugo from 0.31 to 0.51. Old projects are ok. But when I start a new project, there is an error with diacritic in Content _index.md. (front matter)
_index.md:

---
Title: hello š ů ý
---

Error: failed to unmarshal YAML: yaml: invalid leading UTF-8 octet

Please for help.or hint

Look up that error, and the name of your text editor. It may be that your editor is not saving the file as UTF-8. If you configure the editor to save correctly it will work, if that is indeed the issue. :slight_smile:

1 Like

What @maiki said.


I use vscode as my text editor, and did a quick n dirty test:

  1. Create a new site with hugo new site utf8-test
  2. Create layouts/index.html as:
    {{ .Title }}
    
  3. Create index content with hugo new _index.md, then edit file to be:
    ---
    Title: hello š ů ý
    ---
    
  4. Run hugo server, and get expected output of .Title value

Thanks guys. As @maiki said, the error is not in Hugo.
It is about configuration of your text editor (Visual Studio in my case). So I re-saved all files with utf-8 and it is working correctly