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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.