hi,
how can i get UTF8 working, with MySQL 4.1? UTF-8 is now default. The german umlaute (äöü and ß) gets broken.
how can i change from ISO-8859-1 to UTF-8 ?
UTF8 with MySQL 4.1
Moderators: Developer, Contributor
utf
I didn't try, but you can :-)
change all create table ...; to:
create table ... ) character set utf8;
or try this all on tables:
ALTER TABLE ___insert_table_name___ CHARACTER SET utf8;
Please report effects on forum.
Regards
change all create table ...; to:
create table ... ) character set utf8;
or try this all on tables:
ALTER TABLE ___insert_table_name___ CHARACTER SET utf8;
Please report effects on forum.
Regards
-
stonez
-
Stonez
Worked for MySQL 4.1.x
After this, you have to add statements instonez wrote:To make your MySQL using UTF8 encoding, just create the DB under phpMyAdmin and select 'utf8_unicode_ci' in 'Collation' dropdown.
Then go ahead to run the install script.
/Mantis/core/database_api.php
Find
Code: Select all
function db_connect( $p_dsn, $p_hostname = null, $p_username = null, $p_password = null, $p_database_name = null ) {
global $g_db_connected, $g_db;
if( $p_dsn === false ) {
$g_db = ADONewConnection( config_get_global( 'db_type' ) );
$t_result = $g_db->Connect($p_hostname, $p_username, $p_password, $p_database_name );
} else {
$g_db = ADONewConnection( $p_dsn );
$t_result = $g_db->IsConnected();
}
if ( !$t_result ) {
db_error();
trigger_error( ERROR_DB_CONNECT_FAILED, ERROR );
return false;
}else{
//Added by Stonez to add UTF8 encoding to MySQL 2005-12-26
$g_db->Execute("SET NAMES UTF8");
}
$g_db_connected = true;
return true;
}
else{
$g_db->Execute("SET NAMES UTF8");
}
You have to do the same for function_pconnect()
Done.
The page encoding
For anyone which finds this topic searching for utf-8 encoding maybe the problem is not in the database but in the page encoding and it suffices to change the files lang/strings_english.txt and the others by replacing
$s_charset = "windows-1252";
with:
$s_charset = "UTF-8";
as I did on the process of migrating from mysql 4.0 to 5.0 http://www.len.ro/work/tools/migrating- ... -0-to-5.0/
Hope it helps,
Len
$s_charset = "windows-1252";
with:
$s_charset = "UTF-8";
as I did on the process of migrating from mysql 4.0 to 5.0 http://www.len.ro/work/tools/migrating- ... -0-to-5.0/
Hope it helps,
Len