Jump to content

sending foreign characters via ajax


Anti-Moronic

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.

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.