Community Add-Ons
| Maintainers: | draculakos |
Corrupted character on mysql with utf-8
for osCommerce Online Merchant v2.2
I am using the osCommerce RC2 with Greek language utf-8.. While i was exploring in the mysql i saw that the whole language were corrupted.. In the site it was looking good, but in the mysql were TOTALLY corrupted and that a problem..
After all i found a solution..
### open includesfunctionsdatabase.php ####
And find this :
function tep_db_connect($server = DB_SERVER, $username = DB_SERVER_USERNAME, $password = DB_SERVER_PASSWORD, $database = DB_DATABASE, $link = 'db_link') {
global $$link;
if (USE_PCONNECT == 'true') {
$$link = mysql_pconnect($server, $username, $password);
} else {
$$link = mysql_connect($server, $username, $password);
}
if ($$link) mysql_select_db($database);
return $$link;
}
#### And replace with this ####
function tep_db_connect($server = DB_SERVER, $username = DB_SERVER_USERNAME, $password = DB_SERVER_PASSWORD, $database = DB_DATABASE, $link = 'db_link') {
global $$link;
if (USE_PCONNECT == 'true') {
$$link = mysql_pconnect($server, $username, $password);
mysql_query("SET CHARACTER SET utf8");
mysql_query("SET NAMES utf8");
} else {
$$link = mysql_connect($server, $username, $password);
mysql_query("SET CHARACTER SET utf8");
mysql_query("SET NAMES utf8");
}
if ($$link) {
mysql_select_db($database);
tep_db_query('SET time_zone='' . CONFIG_TIME_ZONE . ''');
}
return $$link;
}
Do the same for the adminincludesfunctionsdatabase.php
I hope this helps some people who may have the same problems as me..
Onoufriadis Christoforos
http://www.turbosim.gr
17 July 2008
I am using the osCommerce RC2 with Greek language utf-8.. While i was exploring in the mysql i saw that the whole language were corrupted.. In the site it was looking good, but in the mysql were TOTALLY corrupted and that a problem..
After all i found a solution..
### open includesfunctionsdatabase.php ####
And find this :
function tep_db_connect($server = DB_SERVER, $username = DB_SERVER_USERNAME, $password = DB_SERVER_PASSWORD, $database = DB_DATABASE, $link = 'db_link') {
global $$link;
if (USE_PCONNECT == 'true') {
$$link = mysql_pconnect($server, $username, $password);
} else {
$$link = mysql_connect($server, $username, $password);
}
if ($$link) mysql_select_db($database);
return $$link;
}
#### And replace with this ####
function tep_db_connect($server = DB_SERVER, $username = DB_SERVER_USERNAME, $password = DB_SERVER_PASSWORD, $database = DB_DATABASE, $link = 'db_link') {
global $$link;
if (USE_PCONNECT == 'true') {
$$link = mysql_pconnect($server, $username, $password);
mysql_query("SET CHARACTER SET utf8");
mysql_query("SET NAMES utf8");
} else {
$$link = mysql_connect($server, $username, $password);
mysql_query("SET CHARACTER SET utf8");
mysql_query("SET NAMES utf8");
}
if ($$link) {
mysql_select_db($database);
tep_db_query('SET time_zone='' . CONFIG_TIME_ZONE . ''');
}
return $$link;
}
Do the same for the adminincludesfunctionsdatabase.php
I hope this helps some people who may have the same problems as me..
Onoufriadis Christoforos
http://www.turbosim.gr
17 July 2008
