More than 5 years have passed since last update.
DockerHubの公式Rubyイメージ上で、UTF-8の文字列を読み込んだ場合、Invalid Byte Sequenceエラーが出る。外部エンコーディングがASCIIになっているからなのだが、LANG
やLC_ALL
にen_US.UTF-8
をセットしても有効にならない。
$ locale -a
で確認したところ、C.UTF-8
のみUTF-8が有効になっていたので、LANG
にC.UTF-8
をセットしてやればよい。
$ LANG=C.UTF-8 ruby -e "p Encoding.default_external"
Why not register and get more from Qiita?
- We will deliver articles that match you
By following users and tags, you can catch up information on technical fields that you are interested in as a whole
- you can read useful information later efficiently
By "stocking" the articles you like, you can search right away
Sign upLogin