我在Symfony 1.4中做了一個Web應用程序,它的字符編碼設置爲utf-8(默認)。沒關係,但我想根據情況將字符編碼更改爲s-jis。在symfony中更改佈局html編碼
我試圖與模塊(action.class.php)在下面的代碼,但它不能正常工作:
if('some situation')
{
$context = $this->getContext();
$response = $context->getResponse();
$response->setContentType('application/xhtml+xml; charset=Shift_JIS');
mb_internal_encoding('SJIS-win');
mb_http_output('SJIS-win');
}
是否有人知道如何更改字符編碼temporaly SJIS?
謝謝!
謝謝,但我有辦法在symfony中通過srFilter類來做到這一點。 – Kane
請把答案放在這裏,這樣每個人都可以學習 - 甚至我;) – samura