middleman/middleman — Issue #282: Encoding::CompatibilityError on UTF-8 in YAML frontmatter
Author: artm
Created: 2012-02-26 07:57:35+00:00
State: open

if there are non-latin characters in YAML frontmatter, e.g.

```
---
title: "язык"
---
```

requesting the page results in:

> Encoding::CompatibilityError at ...(my route)...
> incompatible character encodings: UTF-8 and ASCII-8BIT
> file: buffer.rb location: push_text line: 118

Probably the same problem - markdown files with those same characters sometimes result in:

> Encoding::CompatibilityError at ...(my route)...
> incompatible encoding regexp match (UTF-8 regexp with ASCII-8BIT string)
> fie: text.rb location: =~ line: 131

Setting Encoding.default_external to 'UTF-8' in `config.rb` doesn't help. I haven't been able to isolate the cause of the second problem - some files with non-latin characters in markdown break and others not.