同僚がCodeIgniterでアプリを組んでいてメールの本文を 「UTF-8」から「ISO-2022-JP」に変換してから送信すると 特定の文字だけ文字化けする問題に遭遇していた。 一緒に調査したのでそのときの解決策のメモ。 CodeIgniterのバージョン:1.7.0 アプリケーションの文字コード:UTF-8 メール送信にはCIの提供するEmail.phpを利用。 以下のように文字コードをUTF-8からISO-2022-JPに変換。 $text = mb_convert_encoding($text, "ISO-2022-JP", "UTF-8"); この時点でvar_dumpをすると全ての文字が正常に変換されていた。 しかし実際にメールを送信してみると受け取った時点で「目」、「本」 などの特定の文字が文字化けしていた。。。 なのでEmail.phpクラスのなかまで順にdumpを繰り返