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

(P) Codever is an open source bookmarks and snippets manager for developers & co. See our How To guides to help you get started. Public bookmarks repos on Github ⭐🙏
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"