smarty出力手前でカタカナ半角へ

ソース
http://www.thekyo.jp/tech/2006/12/smarty.html

<?php
/* Smarty Include */
require_once('Smarty/Smarty.class.php');
/* create object */
$output_page = new MySmarty();
/* Smartyでテンプレートを画面出力前に「全角->半角化」させる */
$output_page->register_prefilter("convert_encoding_to_eucjp");
/* Smarty使用テンプレートをEUCへ統一 */
$output_page->register_postfilter("convert_encoding_to_sjis");
//表示
$output_page->display("xxxx.tmpl");
/**
*    Smartyテンプレートの全角->半角
**/
function convert_z2h($template_source, &$smart)
{
if (function_exists("mb_convert_kana")) {
return mb_convert_kana($template_source, "ak");
}
return $template_source;
}
?>