Sunday, March 11, 2012

Atlas not using responseEncoding or requestEncoding

Hello, I have the same problem. Have you found a solution other than wait?
How do we solve this? please?Big Smile

Hi guys,

I encounter the same issue. I have done a dirty fix to resolve this. Atlas is using the encodeURIComponent to encode all the form element value. When we use non UTF-8 encoding, this methods is wrong. I overloads the original method and obtains this one.

// corrige des bugs d'atlas lié à l'encoding non utf-8 et les caractères spéciauxvar CS_encodeURIComponent= encodeURIComponent;var CS_decodeURIComponent= decodeURIComponent;encodeURIComponent= function(s){ s= escape(s);while (s.indexOf('/')>=0) { s= s.replace('/','%2F'); }while (s.indexOf('+')>=0) { s= s.replace('+','%2B'); }return s;}decodeURIComponent= function(s){while (s.indexOf('%2B')>=0) { s= s.replace('%2B','+'); }while (s.indexOf('%2F')>=0) { s= s.replace('%2F','/'); }return unescape(s);}

Just add these methods into your page and updatepanel with non UTF-8 encoding will works. But remember that I overload a native JavaScript method, so it may have some underlying issue with other components.

for those who speak french, I wrote a more detailled post about this fix herehttp://blogs.codes-sources.com/cyril/archive/2007/06/10/bug-updatepanel-et-encoding-iso-non-utf-8.aspx


ThanksCyrilCS for providing code.

I want to know one thing, whetehr it is apllicabel for final version of ASP.NET AJAX ?

Because u said it is for Atlas..


I say Atlas becauseMicrosoft ASP.net Ajax Extensions is very longWink but the problem still present in the RTM version ofMicrosoft ASP.net AjaxExtension


Thank you so much, CyrilCS!

Your javascript override works perfectly. Now my Ajax post-backs treat thai characters correctly. The Microsoft AJAX team should incorporate your fix into their future releases of Ajax.


This is fixed in Orcas beta 2 by always using UTF-8 in the UpdatePanel response.

No comments:

Post a Comment