Jump to content

Archived

This topic is now archived and is closed to further replies.

imop

MySQL and Text out put to front end and etc.

Recommended Posts

Greeting fellas!

 

I have wrote some one post about this problem on language displaying in database, but i`m back with this and i need help!

 

So the languages i need to be supported are: Latvian, English, Russian - with English i don`t have any problem, but with Latvian and Russian language is pain in my ass!

 

So at the admin site i have changed charset to UTF-8, it`s the best way to have combined Latvian and Russian languages, because they have special charters (example for word`s - "at home": LV - mājās, RU - дома).

 

For admin panel:

If i change encoding to windows-1257 what stands for Latvian language

Or if i change encoding to windows-1251 what stands for Russian language

 

at the moment i have UTF-8 this is the best way to be combined thous languages

 

Encoding for database and in row costumers (for testing) field i have set - utf8_unicode_ci

If i change the database entry for customers_firstname, i change costumers name (Latvian name - Jānis) after saving i get the right name displayed in DB - "Jānis", but costumer will see it like "J?nis" why?

 

If costumer is filling out the form it`s saves client name "Jānis" as "JÄnis", but after if i get data from DB it`s shows the name normaly...

 

 

I have checked my page encoding and it shows UTF-8.

 

Why the imputed name in DB shows "JÄnis"?

 

May this be caused by osC files as they have ANSI encoding?


1) Backup before you make changes on osC.

2) Backup between addon installs on osC.

 

p.s. Usually you can meet me in osC chat for free help and advice ;)

Share this post


Link to post
Share on other sites

Anyone? PLZ!


1) Backup before you make changes on osC.

2) Backup between addon installs on osC.

 

p.s. Usually you can meet me in osC chat for free help and advice ;)

Share this post


Link to post
Share on other sites

Privet.

 

Take a look at this contribution and read this topic

 

 

Privet!

 

Spasibo, vilecel etu uzasnuju bolacku! (It`s saved me and my shop)

 

Thanks!

 

END

 

So what we did is really simple:

 

in - caloge/includes/functions/database.php

 

find this:

 

function tep_db_query($query, $link = 'db_link') {
   global $$link;

   if (defined('STORE_DB_TRANSACTIONS') && (STORE_DB_TRANSACTIONS == 'true')) {
     error_log('QUERY ' . $query . "\n", 3, STORE_PAGE_PARSE_TIME_LOG);
   }

 

after add this:

 

mysql_query("SET CHARACTER SET utf8"); 
mysql_query("SET NAMES 'utf8' ");

 

and you need to change a bit more

 

in cataloge/admin/includes/functions/database.php

 

find this

 

function tep_db_query($query, $link = 'db_link') {
   global $$link, $logger;

   if (defined('STORE_DB_TRANSACTIONS') && (STORE_DB_TRANSACTIONS == 'true')) {
     if (!is_object($logger)) $logger = new logger;
     $logger->write($query, 'QUERY');
   }

 

after add this:

 

mysql_query("SET CHARACTER SET utf8"); 
mysql_query("SET NAMES 'utf8' ");

 

and that`s it!

 

The original came from here ( <- LINK) and here (<- LINK)

 

 

And huge thank`s to multimixer who pointed this to me!

 

END


1) Backup before you make changes on osC.

2) Backup between addon installs on osC.

 

p.s. Usually you can meet me in osC chat for free help and advice ;)

Share this post


Link to post
Share on other sites

Late reply, but anyway:

 

After all that fixes - is search works well with Cyrillic on your website?

 

 

Yes it dose!


1) Backup before you make changes on osC.

2) Backup between addon installs on osC.

 

p.s. Usually you can meet me in osC chat for free help and advice ;)

Share this post


Link to post
Share on other sites

×