Jump to content

Charset trouble


Andy17

Recommended Posts

Hey guys,

 

 

Firstly, this is not solely about PHP, but rather a mixture of jQuery, JSON, PHP and MySQL, but I hope it's OK to post it here. I am sending data to a PHP script via the jQuery ajax function. The data is encoded in JSON and then decoded in the PHP script. This all works great. However, I noticed that one of my queries does not work with certain characters in the data (more specifically the Danish characters æ, ø and å). The query works with other data except those. The query also works if I hard code the data into the PHP script, even if it contains any of the three mentioned characters. This leads me to believe that the problem is somehow connected to character sets when sending data from one page to my PHP script with jQuery.

 

The page from which the data is sent to the PHP script has a charset of iso-8859-1 and the columns utf8_danish_ci. I can indeed see that those are not the same, but I have tried to use the PHP uft8_encode() function in my PHP script, but without luck.

 

I have not posted any code because I don't really find this relevant in relation to my problem.

 

Can anyone think of a way to solve this without changing charset on the page from which the data is sent from (to the PHP script)?

 

 

Thanks in advance,

Andy

Link to comment
https://forums.phpfreaks.com/topic/235128-charset-trouble/
Share on other sites

Archived

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

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.