6 * @subpackage PluginsModifierCompiler
\r
10 * Smarty to_charset modifier plugin
\r
12 * Type: modifier<br>
\r
13 * Name: to_charset<br>
\r
14 * Purpose: convert character encoding from internal encoding to $charset
\r
16 * @author Rodney Rehm
\r
17 * @param array $params parameters
\r
18 * @return string with compiled code
\r
20 function smarty_modifiercompiler_to_charset($params, $compiler)
\r
22 if (!Smarty::$_MBSTRING) {
\r
23 // FIXME: (rodneyrehm) shouldn't this throw an error?
\r
27 if (!isset($params[1])) {
\r
28 $params[1] = '"ISO-8859-1"';
\r
31 return 'mb_convert_encoding(' . $params[0] . ', ' . $params[1] . ', "' . addslashes(Smarty::$_CHARSET) . '")';
\r