Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

My jekyll site can't build: Liquid Exception: incompatible character encodings

Tags:

I do not know what I changed, but today I can no longer build my site's front page with jekyll successfully. It is now complaining about:

[2012-10-30 14:22:10] regeneration: 1 files changed
Liquid Exception: incompatible character encodings: UTF-8 and ASCII-8BIT in index.html

And I'm at a loss to resolve the issue. I believe it's being introduced via a loop of posts I create on the front page, index.html, where I include an excerpt from the last 'n' posts. I used file(1) against my _posts/ directory, and do have some mixture in there:

_posts/2012-08-10-canned-responses-your-silent-partner.md:    UTF-8 Unicode English text, with very long lines
_posts/2012-08-21-alternate-ssh-for-osx.md:                   UTF-8 Unicode English text, with very long lines
_posts/2012-08-21-appus-interruptus.md:                       ASCII English text
_posts/2012-10-25-emoryfocuslight.md:                         ASCII English text
_posts/2012-10-28-distributed-social-networking-with-tent.md: ASCII English text, with very long lines

I'm not sure if this is my problem, though. I use vim and bbedit to edit these files, and they're stored in Dropbox (I build/stage in my Dropbox folder but publish elsewhere). Most of my writing/editing is done on OS X.

When I search for this error message I get a lot of hits for rails applications or forcing ruby gems to use a specific encoding, I don't know if that is relevant or would even help me. Would love to be aimed in the right direction or be told how to resolve this situation. It's a sad state of affairs!

like image 324
incumbent Avatar asked Oct 30 '12 19:10

incumbent


2 Answers

A fix is to use the configuration

Jekyll Configuration

Example

encoding: utf-8

No mention of UTF fix

like image 148
Zombo Avatar answered Sep 25 '22 03:09

Zombo


Additionally, you might need to change the code page of the console window to UTF-8 in case you get a “Liquid Exception: Incompatible character encoding” error during the site generation process. It can be done with the following command:

chcp 65001

(From the jekyll "Installation for Windows page": http://jekyllrb.com/docs/windows/)

like image 40
MarkusAtCvlabDotDe Avatar answered Sep 24 '22 03:09

MarkusAtCvlabDotDe