6 * @subpackage PluginsModifierCompiler
10 * Smarty to_charset modifier plugin
12 * Name: to_charset<br>
13 * Purpose: convert character encoding from internal encoding to $charset
17 * @param array $params parameters
19 * @return string with compiled code
21 function smarty_modifiercompiler_to_charset($params)
23 if (!Smarty::$_MBSTRING) {
24 // FIXME: (rodneyrehm) shouldn't this throw an error?
28 if (!isset($params[1])) {
29 $params[1] = '"ISO-8859-1"';
32 return 'mb_convert_encoding(' . $params[0] . ', ' . $params[1] . ', "' . addslashes(Smarty::$_CHARSET) . '")';