* @return string $charset Adjusted name of charset
*/
function fixcharset($charset) {
- // minus removed from function names
- $charset=str_replace('-','_',$charset);
+ /* remove minus and characters that might be used in paths from charset
+ * name in order to be able to use it in function names and include calls.
+ */
+ $charset=preg_replace("/[-:.\/\\\]/",'_',$charset);
// windows-125x and cp125x charsets
$charset=str_replace('windows_','cp',$charset);
}
setlocale(LC_ALL, $longlocale);
// Workaround for plugins that use numbers with floating point
- // It might be removed if plugins use correct decimal delimiters
- // according to locale settings.
+ // It might be removed if plugins use correct decimal delimiters
+ // according to locale settings.
setlocale(LC_NUMERIC, 'C');
// Workaround for specific Turkish strtolower/strtoupper rules.
// Many functions expect English conversion rules.
global $languages, $sm_notAlias, $default_charset, $lossy_encoding;
if (isset($lossy_encoding) && $lossy_encoding )
- return true;
+ return true;
// convert to lower case
$input_charset = strtolower($input_charset);