Locale problems


My apologies in advance for what I’m sure will be a question with clarity proportional to my expertise.
I have an OSx server upon which Jekyll and all it’s dependencies are installed. I want to be able to SSH in from any computer to make changes and rebuild the site.

If I attempt to rebuild the site without changing LANG to en_US.UTF-8, the builder throws error:
Conversion error: Jekyll::Converters::Scss encountered an error while converting 'assets/css/main.scss': Invalid US-ASCII character "\xE2" on line 54

I can manually change LANG by sending export LANG=en_US.UTF-8 and then the site builds just fine.

SSH forces its locale on connection, but I disabled that by editing /etc/ssh/shh_config and commenting out the line “SendEnv LANG LC_*”, and OSx is set to not reset the locale on startup. Nevertheless, the OSx defaults to “C” (eg LC_CTYPE=“C” and so on), and I can’t seem to find any explanation of how to change this permanently. If you have any recommendation on that, then I’ll take it, but it seems to me that a better way to solve this might be simply to alter something in Jekyll. Part of the problem here is that I don’t fully understand how this locale thing works; if it’s by usergroup, session, etc, and when/how Jekyll is looking for it.

In main.scss (where the error originated) I do have @charset "utf-8"; and in my _config.yml I do have locale: "en"

Is there anywhere in yml/gem/scss/hades I can set locale lang to default to en_US.UTF-8 and ignore the locale of the machine it’s building on?

Thanks in advance… Hope that made at least a little sense.


no idea about controlling the locale on the server, but I do remember having that issue once. For me I ended up removing comments in the css - something about the css comment was causing it. The line nunber and the character it said it was were both incorrect if I remember correctly.

This thread has several solutions, including a line in config.yml:



Thanks for the reply!
A friend guided me to a good workaround, so here it is for future users who might run into this problem.
We edited the rakefile and added a build command that sets the LANG parameter for a one-off build.

In Rakefile:

task :build do
  system "env LANG=\"en_US.UTF-8\" bundle exec jekyll build"

then just run “rake build” instead of the usual “bundle exec jekyll build”