Anti-Moronic Posted January 30, 2010 Share Posted January 30, 2010 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 More sharing options...
premiso Posted January 30, 2010 Share Posted January 30, 2010 You do not want to escape it, you want to urlencode / urldecode the data. Link to comment https://forums.phpfreaks.com/topic/190408-sending-foreign-characters-via-ajax/#findComment-1004426 Share on other sites More sharing options...
Anti-Moronic Posted January 30, 2010 Author Share Posted January 30, 2010 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. Link to comment https://forums.phpfreaks.com/topic/190408-sending-foreign-characters-via-ajax/#findComment-1004428 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.