ScuL wrote: If anybody knows how to convert database-contents to UTF-8 in a easy manner please let me know.
ScuL wrote: what I did was using the mySQL replace command to replace all the old characters by unicode accepted characters.
this becomes a problem when you aren´t talking about european (western characters) but asian like chinese or japanese. they are very hard to convert.. unfortunately
Code: Select all
Charset: utf-8
Code: Select all
ALTER TABLE `test table` CHANGE `a` `a` VARCHAR( 10 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL
Code: Select all
//
// Set charecters set parameters according to MySql version.
//
$result = mysql_query('SELECT VERSION()') or die('Query failed: ' . mysql_error());
$mysql_version = mysql_fetch_array($result, MYSQL_ASSOC);
list($mysql_version_majour,$mysql_version_minor,$mysql_version_patch) = split('\.',$mysql_version['VERSION()']);
if (($mysql_version_majour >=4) && ($mysql_version_minor>=1))
{
$result = mysql_query('SET character_set_client = utf8') or die('Query failed: ' . mysql_error());
$result = mysql_query('SET character_set_results = utf8') or die('Query failed: ' . mysql_error());
$result = mysql_query('SET character_set_connection = utf8') or die('Query failed: ' . mysql_error());
}
Code: Select all
»
Code: Select all
mb_internal_encoding('UTF-8');
Code: Select all
php_value mbstring.func_overload 7
Code: Select all
php_value mbstring.func_overload 7