Force UTF-8 encoding for all Ruby 1.9 stuff
When you get some wired errors with encoding, for instance
Encoding::InvalidByteSequenceError: "\xC3" on US-ASCII
You can force Ruby to use UTF-8 encoding by:
export RUBYOPT=-Ku
After that you should restart your application.
I suggest to add this line into environment/profile or your shell config file.
echo "export RUBYOPT=-Ku" > /etc/profile
Written by Bartłomiej Danek
Related protips
2 Responses

Be aware that -Ku has been deprecated for a while, around some versions of 1.9.3 and is not recognized at in 2.0.
over 1 year ago
·

Good to know! Thanks for your comment!
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ruby
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#