Fixing Invalid US-ASCII character "\xE2" on line 54 on MacOS


Dev-Bookmarks Logo

(P) Bookmarks.dev - Open source Bookmarks and Code Snippets Manager for Developers & Co. See our How To guides to help you get started. Public Bookmarks Repo on Github - Star


In this post I will show how to fix the infamous Jekyll encoding exception on MacOS:

Conversion error: Jekyll::Converters::Scss encountered an error while converting 'assets/css/main.scss':
Invalid US-ASCII character "\xE2" on line 54

Well I got inspired from the solution presented here[^1] when starting a cloud image. [^1]: https://github.com/mmistakes/minimal-mistakes/issues/1183

Instead of starting the server for local development with the usual command:

bundle exec jekyll serve

I use the following environment variables before the command:

LANG="en_US.UTF-8" LC_ALL="en_US.UTF-8" bundle exec jekyll serve

To make the solution permanent, I added the environment variables in my .bash_profile file:

# lang variables
export LC_ALL="en_US.UTF-8"
export LANG="en_US.UTF-8"
export LANGUAGE="en_US.UTF-8"

References

Subscribe to our newsletter for more code resources and news

Adrian Matei

Adrian Matei
Life force expressing itself as a coding capable human being

How to resize pictures from folder in Node.js with Jimp

Simple api tool implementation on localhost to resize from folder in Node.js with Jimp Continue reading