<?php
ini_set('display_errors','On');
require_once("./Smarty/libs/Smarty.class.php");
$smarty = new Smarty;
$smarty->template_dir = './Smarty/libs/templates/';
$smarty->compile_dir = './Smarty/libs/templates_c/';
$smarty->config_dir = './Smarty/libs/configs/';
$smarty->cache_dir = './Smarty/libs/cache/';
$test = '漢字のテスト';
$smarty->assign("test", $test);
$smarty->register_outputfilter('EUCtoSJISwin_Encoding');
$smarty->display("default.tpl");
function EUCtoSJISwin_Encoding($tpl_output, &$smarty){
$tpl_output = mb_convert_encoding($tpl_output,'sjis-win','EUC-JP');
return $tpl_output;
}
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=sjis-win">
<META http-equiv="Content-Style-Type" content="text/css">
<TITLE>これはテストです</TITLE>
</HEAD>
<BODY>
<CENTER>
<TABLE border="1" width="" cellpadding="0" cellspacing="0" bgcolor="#ffffff">
<TBODY>
<TR>
<TD>aaa{$test}</TD>
</TR>
</TBODY>
</TABLE>
</CENTER>
</BODY>
</HTML>