内部文字エンコードはEUC-JP。
出力文字エンコードはShift_JIS。
app_controllerのafterFilterでSJISに変換して出力してる。
function afterFilter() { $this->output = mb_convert_encoding($this->output, 'SJIS', 'EUC-JP'); }
キャッシュ使うと、EUC-JPで出力された。
HTMLのcharsetはShift_JISなので、文字化け。
調べてみると、何故かUTF-8で保存されていました。
なので、cache.php の __writeFile の return の前に下記を追加して強制的に SJIS に変換しました。
上記で書いてある通り、cache.phpの__writeFile()でreturn前に文字コード変換したら、うまくいきました。
cake/libs/view/helpers/cache.php
$file .= $content; $file = mb_convert_encoding($file, 'SJIS', 'EUC-JP'); return cache('views' . DS . $cache, $file, $timestamp);