Unmarshal failed

Using the tutorial on Hugo and getting this error

PS C:\Hugo\quickstart> hugo new posts/my-first-post.md
Error: “C:\Hugo\quickstart\config.toml:1:1”: unmarshal failed: Near line 0 (last key parsed ‘’): bare keys cannot contain ‘�’

My config.toml file using notepad had lots of Chinese characters in it, so I changed to the following:
‘theme = “ananke”’ and saved but the error still persists

The echo command worked OK so I suspects that Hugo might be written using a non standard character set??

Any ideas

Ok, after much head scratching, I opened it in notepad and went to save as, and it was in UTF16 LE, so I saved the file as UTF8

Now in VS code, it is all in Chinese characters??? So what is happening?

I am now able even though my theme declaration in my config.toml file is now in Chinese to run:
hugo new posts/my-first-post.md and it creates the content

Could have something to do with VS code but I dont think so as when I tried to echo this info in english to the config.toml it still failed. Its a bug in Hugo

I hope this helps anyone else who has this issue

However my config.toml looks like this, so will be a problem
桴浥⁥‽愢慮歮≥

Please share the files you are working with in a git repo, otherwise we can’t reproduce your errors. :slight_smile:

1 Like

The error is in your config.toml file:

baseURL = "http://example.org/"
languageCode = "en-us"
title = "My New Hugo Site"
'theme = "ananke"' 

You just need to remove the ’ in theme:

baseURL = "http://example.org/"
languageCode = "en-us"
title = "My New Hugo Site"
theme = "ananke"

This topic was automatically closed after 20 hours. New replies are no longer allowed.