Ben d'état

Ben Scott


~/UTF issue when running Jekyll on Windows

23 Jun 2013

UPDATE: Running chcp 65001 seems to work just as well, rather than messing with the environment.

I ran in to an issue when trying to set up Jekyll for this site on my Windows PC:

D:\source\belfry_images\belfryimages.github.com>jekyll serve --watch
Configuration file: D:/source/belfry_images/belfryimages.github.com/_config.yml
            Source: D:/source/belfry_images/belfryimages.github.com
       Destination: D:/source/belfry_images/belfryimages.github.com/_site
      Generating... ←[31m  Liquid Exception: incompatible character encodings: UTF-8 and CP850 in default.html←[0m
error: incompatible character encodings: UTF-8 and CP850. Use --trace to view backtrace

The important thing here is the incompatible character encodings: UTF-8 and CP850. I tried various things like blowing away the site and resaving the files using UTF-8 to no avail. I eventually found a blog post (in French) that gives an answer (translated by Google):

These errors can have an impact on the blog posting. And in some cases, it may prevent the proper functioning of Jekyll. There is a workaround to this problem. Simply run the following commands before starting the Jekyll server:

set LC_ALL = en_US.UTF-8
set LANG = en_US.UTF-8

This command is used to tell Windows that the encoding used is UTF-8. If you raise Jekyll after handling these errurs are gone.

Add the LC_ALL and LANG settings to System -> System Properties -> Environment Variables (under either User variables or System variables) and restart your shell.

Wooo. Go Jekyll.


comments powered by Disqus