本文整理汇总了PHP中Ethna_Controller::setClientEncoding方法的典型用法代码示例。如果您正苦于以下问题:PHP Ethna_Controller::setClientEncoding方法的具体用法?PHP Ethna_Controller::setClientEncoding怎么用?PHP Ethna_Controller::setClientEncoding使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ethna_Controller
的用法示例。
在下文中一共展示了Ethna_Controller::setClientEncoding方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setUp
function setUp()
{
$ctl = new Ethna_Controller();
$ctl->setClientEncoding('EUC-JP');
$ctl->setActionForm(new Ethna_ActionForm($ctl));
$this->local_ctl = $ctl;
$plugin = $ctl->getPlugin();
$this->vld = $plugin->getPlugin('Validator', 'Strmincompat');
}
示例2: setClientEncoding
/**
* @test
*/
function setClientEncoding()
{
$this->controller->setClientEncoding('Shift_JIS');
$this->assertEquals('Shift_JIS', $this->controller->getClientEncoding());
}
示例3: unset
function _test_smarty_modifier_wordwrap_i18n($expected, $input_str, $width, $break = "\n", $indent = 0)
{
unset($GLOBALS['_Ethna_controller']);
$ctl = new Ethna_Controller();
$actual = smarty_modifier_wordwrap_i18n($input_str, $width, $break, $indent);
$this->assertEqual($expected, $actual);
unset($GLOBALS['_Ethna_controller']);
// SJIS
$ctl = new Ethna_Controller();
$ctl->setClientEncoding('SJIS');
$sjis_input = mb_convert_encoding($input_str, 'SJIS', 'UTF-8');
$sjis_expected = mb_convert_encoding($expected, 'SJIS', 'UTF-8');
$sjis_actual = smarty_modifier_wordwrap_i18n($sjis_input, $width, $break, $indent);
$this->assertEqual($sjis_expected, $sjis_actual);
unset($GLOBALS['_Ethna_controller']);
// EUC-JP
$ctl = new Ethna_Controller();
$ctl->setClientEncoding('EUC-JP');
$eucjp_input = mb_convert_encoding($input_str, 'EUC-JP', 'UTF-8');
$eucjp_expected = mb_convert_encoding($expected, 'EUC-JP', 'UTF-8');
$eucjp_actual = smarty_modifier_wordwrap_i18n($eucjp_input, $width, $break, $indent);
$this->assertEqual($eucjp_expected, $eucjp_actual);
}