cagnbq
Last Updated: February 25, 2016
·
2.417K
· bartlomiejdanek
Bard2

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
Say Thanks
Respond

2 Responses
Add your response

5281
58a62321e4961bb65cc202bfd9cc963a

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 ·
5283
Bard2

Good to know! Thanks for your comment!

over 1 year ago ·