PDA

View Full Version : Encoding problem after upgrade


Bellinis
02-29-2008, 08:35 AM
Just upgraded GAL to the latest version and after the upgrade it stopped working.
(Using vbulletin vBulletin 3.6.4)

All GAL menu items in my admincp show this error:
Warning: mb_convert_encoding() [function.mb-convert-encoding]: Illegal character encoding specified in /geek/gal/includes/gal_class_core.php on line 141

Warning: mb_convert_encoding() [function.mb-convert-encoding]: Unknown encoding "windows-1250" in /geek/gal/includes/gal_class_core.php on line 144


What's wrong and how do I correct this error?

Thanks

Morgan
03-02-2008, 04:11 AM
PHP's mbstring (http://www.php.net/manual/en/ref.mbstring.php) doesn't appear to support Windows-1250 so try the following. In both the gal_class_core.php and gal_class_dictionary.php files find the following:

$text = mb_convert_encoding($text, 'UTF-8', $charset);

And beforehand add the following:

if (strtolower($charset) == 'windows-1250')
{
$charset = 'ISO-8859-2';
$win = array("\x9A", "\x9D", "\x9E", "\x8A", "\x8D", "\x8E");
$iso = array("\xB9", "\xBB", "\xBE", "\xA9", "\xAB", "\xAE");
$text = str_replace($win, $iso, $text);
}

Bellinis
03-03-2008, 08:55 AM
Thanks Morgan! Seems to be working fine now :)

Going to check out the rest and will let you know if in encounter any more problems..... ;)