Jump to content

Recommended Posts

I am totally confused. Here is the string I am sending via ajax:

 

"fdsafdsafdsa & fdasfdsa  華"

 

When I send that with the content-type set as: application/x-www-form-urlencoded

 

I receive in php POST:

 

"fdsafdsafdsa"

 

..everything after the ampersand is cut off. Yet if I escape() the string in javascript I get this:

 

"fdsafdsafdsa & fdasfdsa  %u83EF"

 

..then I can't for the life of me suss out how to decode this. Plus the and isn't even an &

 

Can someone please point me in the right direction? Thanks.

 

Link to comment
https://forums.phpfreaks.com/topic/190408-sending-foreign-characters-via-ajax/
Share on other sites

That's what I was thinking, but isn't it already doing that by setting the content-type to:

 

application/x-www-form-urlencoded

 

When I try encodeURI it does the same thing and cuts off the &. If I leave it so it just passes through the above, cuts off the &.

 

What is '%u83EF' as an example and can I decode it with php?

 

Thanks for the help.

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.