Open Source & Stuff  
  |     Main Site     |      Forum     |     Contact     |
Ajax Linked Select boxes :  forum.Salix.gr forum.Salix.gr
Comments, questions, usage, bugs. 
Goto Thread: PreviousNext
Goto: Forum ListMessage ListNew TopicSearchLog In
messagenon-latin character problem
Posted by: numen (IP Logged)
Date: November 01, 2009 02:32AM

Thank for the awesome scripts.

I use Linked selected boxes for a setting of user's country, province and, city. Just like that. And it works fine when I modified it to fit my database.

But when a name of city, for the example, is in a local language, the selection boxes' option sometimes can't be displayed right.

I found this problem happens when the city name is in non-latin character.

I read the earlier thread here "non-english character problem" [forum.salix.gr], though it refered to an older version of this script. Just a little help. I tried the city name in french and it works great. But in Chinese, the options are displayed like "??????" whatever the $sc_ajax_select_boxes->xml_encoding is set.

My database table and varchar fields are all in utf8_general_ci, and they are displayed right in phpmyadmin whatever the local languages are used. and the php files are also saved in UTF-8.

Please help me with this matter. Thanks.



Edited 1 time(s). Last edit at 11/01/2009 02:35AM by numen.

messageRe: non-latin character problem
Posted by: panos (IP Logged)
Date: November 06, 2009 03:47AM

Hi,
i face similar problems with utf8 strings (my native language is greek) and i dont have
solutions. For example if i add greek text in utf8 field using phpmyadmin they are not displayed
properly in web pages, shown like yours ??????, but i store the string using a php script it shows
correct in my web pages and ???? in phpmyadmin.
I did that test with linked select boxes 5 min ago and even if webpage and xml encoding are set to utf8 i get ???????

If you make a query and show those texts in the web page with a little php script do they display correctly?

messageRe: non-latin character problem
Posted by: numen (IP Logged)
Date: November 07, 2009 02:53AM

thanks for your reply.

I made some more test. The problem is just about the utf8. The french words I have tested above is not displayed properly when the browser(firefox) page encoding is set to utf8. But when it is set to iso-8859-1, the french words are displayed right.

The phpmyadmin problem you met is that your database is not set to utf8. I have met such kind of problem before and I used a php script to convert all DB data to utf8.

mysql encoding, database encoding, table encoding, field encoding, browser page encoding and everything else, they are all in utf8 in my test. but the linked select boxes still display ?????

I run a php script to see whether those texts used in Linked Select Boxes are displayed properly. And they are all displayed right in my browser. And still every thing is set to utf8.

I think it seems that the record read from mysql is not proper encoded. So the the texts in linked select boxes are not displayed properly.

Could there be a solution? Thank you so much.

messageRe: non-latin character problem
Posted by: numen (IP Logged)
Date: November 07, 2009 03:48AM

wow, I am so happy to find a solution.
yes, it 's about Mysql Connection Character Sets and Collations

here is the solution for my use:

in top_script.php,

find:
$link = @mysql_connect($dbserver_name, $dbserver_username, $dbserver_password);

below it add:
mysql_query("SET NAMES 'utf8'",$link);


in sc_classes.php, around line 252,

find:
$link = @mysql_connect($dbserver_name, $dbserver_username, $dbserver_password);

add :
mysql_query("SET NAMES 'utf8'",$link);

thanks for your help and I hope to see the next version of this awesome script.



Sorry, only registered users may post in this forum.

All Rights Reserved 2006 Salix.gr  |  Design by Ades Design |  Hosting by e-emporio |  forum.Salix.gr powered by Phorum