6 * @subpackage PluginsModifierCompiler
10 * Smarty from_charset modifier plugin
12 * Name: from_charset<br>
13 * Purpose: convert character encoding from $charset to internal encoding
17 * @param array $params parameters
19 * @return string with compiled code
21 function smarty_modifiercompiler_from_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] . ', "' . addslashes(Smarty::$_CHARSET) . '", ' . $params[1] . ')';