MyBB Community Forums

Full Version: [F] Language and Charset Problems
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9 10 11
When upgrading my board I got an error. I have an user having an ASCII name.
She calles herself "¤§å®åh¤"
When I upgraded it showed up like "????h?".

This also goes for threads with her name in it.

Also there is an bug with every user getting set to MyBB theme instead of default.

UPDATE mybb_users style=0 WHERE style=2
fixes that.
Quote:When upgrading my board I got an error. I have an user having an ASCII name.
She calles herself "¤§å®åh¤"
When I upgraded it showed up like "????h?".
This is because of the document encoding used in 1.2 (UTF-8). You can update her username and it'll show fine, otherwise you can change the character set in inc/languages/english.php to "ISO-8859-1" and the characters will show fine.
Is there no way to upgrade the posts aswell as the usernames to UTF-8 when upgrading? as it is the default now. or an button todo so even.
If you have the PHP iconv and multibyte extensions installed you could make use of them to convert things over.

An example which would need to be adopted to to also change other fields would be (for posts):
<?php
define("IN_MYBB", 1);
require "./global.php";
$query = $db->query("SELECT * FROM ".TABLE_PREFIX."posts");
while($post = $db->fetch_array($query))
{
	$post['subject'] = iconv("ISO-8859-1", "UTF-8//TRANSLIT", $post['subject']);
	$post['message'] = iconv("ISO-8859-1", "UTF-8//TRANSLIT", $post['message']);
	$db->query("UPDATE ".TABLE_PREFIX."posts SET subject='".$db->escape_string($post['subject'])."', message='".$db->escape_string($post['message'])."' WHERE pid='{$post['pid']}'");
}
echo "Done";
?>

Of course, all of these problems now make me wonder if it is better to switch MyBB back to the ISO-8859-1 encoding.

Chris
Refer to a pre reported bug in beta forums, It is stiil exist:
while I going to admin/settings.php my Site name apeared as None UTF characters... I should change my encoding for utf if i wana see them OK. and also if I change a general setting , forum name apears very bad...
this bug reported in beta test forum but now it still exists
bests
My board has a mix of English and Turkish album reviews and this upgrade has caused havoc. Some of the posts that have have these characters go to white pages and nothing loads. Very strange.

Where do I place this php code?
You can go to inc/languages/english.php and find.
$langinfo['charset'] = "UTF-8";
Change it to:
$langinfo['charset'] = "iso-8859-1";
And it should work. that's the standard charset for 1.1.x series.
It worked - Excellent!
Warning: Cannot modify header information - headers already sent by (output started at /home/www/albasport.com/inc/languages/english.php:1) in /home/www/albasport.com/inc/functions.php on line 1057
You have one or more blank lines or spaces before the <?php in inc/languages/english.php.

Remove everything before the opening <?php and you'll be fine.
Pages: 1 2 3 4 5 6 7 8 9 10 11