Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.5.6

Bug #8183 JS form sending code is LATIN only
Submitted: 2006-07-11 12:00 UTC Modified: 2006-08-09 00:38 UTC
From: greg at claranet dot fr Assigned: jeichorn
Status: Closed Package: HTML_AJAX (version 0.4.1)
PHP Version: 4.3.10 OS: independent
Roadmaps: (Not assigned)    
Subscription  


 [2006-07-11 12:00 UTC] greg at claranet dot fr (greg)
Description: ------------ In the javascript code, the method "formEncode" uses the "escape" function which is ISO-8850 only. That implies all data sent are incorrectly encoded if the page is using another encoding (such as UTF), and therefore the data should be converted when received or could be considered corrupted. To avoid that, you should change line 327 of HTML_AJAX.js from value = escape(el.value); to value = encodeURI(el.value); I'm not sure about the other occurences of calling 'escape', though. Test script: --------------- escape('é'); Expected result: ---------------- %C3%A9 Actual result: -------------- %E9

Comments

 [2006-07-11 12:25 UTC] jeichorn at php dot net (Joshua Eichorn)
Fixed in svn, I can provide a 0.5.0pre pearball if you need it
 [2006-07-11 18:08 UTC] greg at claranet dot fr
>Fixed in svn, I can provide a 0.5.0pre pearball if you need it yes please :) greg
 [2006-07-11 18:17 UTC] jeichorn at php dot net (Joshua Eichorn)
formEncode is fixed but post hasn't been yet (new method in 0.5.0) http://bluga.net/projects/HTML_AJAX/HTML_AJAX-0.4.9.1.tgz This is a preview release so let me know if you have any problems
 [2006-08-09 00:38 UTC] jeichorn at php dot net (Joshua Eichorn)
Fix in svn thanks