Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

UTF-8 Database and X-Cart

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 03-19-2007, 04:15 AM
 
m0bius m0bius is offline
 

Newbie
  
Join Date: Oct 2006
Posts: 5
 

Default 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.
__________________
X-Cart 4.1.9
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 07:30 AM.

   

 
X-Cart forums © 2001-2020