MyBB Community Forums

Full Version: iso ...-1 to utf-8?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
anyone know how to convert all the threads and posts from the mybb 1.1.8 charset "iso...-1" to utf-8 (mybb1.2 charset)?i want it because use iso...-1 i can read the threads and posts but all the forum titles and descriptions.i can't read anymore even that i can't type my language!
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 Code:

<?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


where do i add this code?can you instruct every steps
That's not the post I was sending you to. Shy
that's it?i clicked your link
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.
no that is not what i mean,i mean change all the posts and threads in database from iso-8859-1 to utf-8
You could try to convert the dump of your database: http://kb.modernbill.com/index.php?article=93
yes that's what i need.thanks Michael
but reading it.i don't understand.hi`
can you instruct me how to do with mybb
maybe anyone create a topic to instruct every steps how to convert all threads and posts in database charset from iso-8859-1 (1.1.xmybb) to UTF-8 (1.2)..that's so helpful
Pages: 1 2 3