柄にもなく釣りっぽいタイトルですが、本文中には特にそんな派手なものはありません。 はじめに Rubyの多言語化に関してまず読むべき、るびま記事である「Ruby M17N の設計と実装」が2009年の記事ですから四捨五入すればもう、ひと昔前のことですが、それでもなかなか移行は進まないもののようなので(あと少々クセがある)、エンコーディングの推測についてまとめた記事を書いてみます。 エンコーディングの変換 エンコーディングの変換については、例の記事の「エンコーディングの変換」の節( http://magazine.rubyist.net/?0025-Ruby19_m17n#l76 )と、詳細は最新のマニュアルの String#encoding についてのページ( https://docs.ruby-lang.org/ja/latest/method/String/i/encode.html )