Skip to content

Instantly share code, notes, and snippets.

@ron623
Created July 14, 2016 01:17
Show Gist options
  • Save ron623/d314a3d3c1f494f816c018edca486e8a to your computer and use it in GitHub Desktop.
Save ron623/d314a3d3c1f494f816c018edca486e8a to your computer and use it in GitHub Desktop.
Encoding::CompatibilityError
2つのエンコーディング間に互換性がない場合に発生する例外。
エンコーディングの異なる文字列を連結しようとした場合などに発生します。
"あ".encode("EUC-JP") + "あ".encode("UTF-8")
#=> Encoding::CompatibilityError: incompatible character encodings: EUC-JP and UTF-8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment