Invalid byte sequence in US-ASCII (ArgumentError) when putting UTF-8 string in data yaml file

Hi, I can’t figure out how to configure Middleman to read UTF-8 encoded data yaml files.

Even after configuring default encoding (internal/external) in config.rb I get the error

/usr/local/rvm/gems/ruby-2.3.4/gems/middleman-core-4.2.1/lib/middleman-core/util/data.rb:60:in \match’: invalid byte sequence in US-ASCII (ArgumentError)`

Any ideas how to fix this?

UPDATE: it’s problem with frontmatter:

--- addr: data.contact.address ---

do not work, but when I converted it to haml variable:

- addr = data.contact.address

Everything is ok.

If you are on macOS or Linux, you can start Middleman this way to force it to use UTF-8:

LANG=en_US.UTF-8 LANGUAGE=en_US.UTF-8 LC_ALL=en_US.UTF-8 middleman

Not sure about Windows, though.