X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   UTF-8 Database and X-Cart (https://forum.x-cart.com/showthread.php?t=29783)

m0bius 03-19-2007 04:15 AM

UTF-8 Database and X-Cart
 
Hello there,

I just wanted to share with everyone my minor X-Cart modification. I have a website which is entirely a UTF-8 site. In order for X-Cart to be fully compatible I changed the .sql files coming with X-Cart modifying the database tables to use UTF-8 collation and the template pages UTF-8 character encoding.

In order to properly store UTF-8 data in the database, however mysql NAMES must be set to utf8. This must be the first query executed after a mysql connect.

Therefore I modified include/func/func.db.php function db_connect (line 42):
Quote:

return mysql_connect($sql_host, $sql_user, $sql_password);


to

Quote:

$ret = mysql_connect($sql_host, $sql_user, $sql_password);
@mysql_query('SET NAMES utf8');
return $ret;


Hope that helped anyone.


All times are GMT -8. The time now is 06:16 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.