Link to home
Start Free TrialLog in
Avatar of RichardPogson
RichardPogson

asked on

Yahoo YUI Connection Charset Data Corruption Problem

I am using Yahoo's YUI to post some textbox data to a Classic ASP page. I am having some difficult with the character encoding during this process. The textbox can contain double byte chars such as the £ symbol. The YUI then grabs the form and posts this using UTF8 which only supports single byte chars. The posted £ is sent as two characters C2 and A3. The asp page at the other end of the post effectively receives corrupted data. Has anyone encountered this problem before. Can I force the YUI not to use UTF8?
Avatar of Michel Plungjan
Michel Plungjan
Flag of Denmark image

Try £
Avatar of RichardPogson
RichardPogson

ASKER

I have now got a working solution though it is not perfect. The receiving asp page must have the UTF-8 charset enrforced so at the top of the file add:
@ CodePage=65001

Before any  data passed by the javascript  is read add the following:
Response.CodePage = 65001
Response.CharSet = "utf-8"

Now the double byte chars that were passed can not be caught by a replace but are writen out correctly.  I think this is due to asp's request object being unable to alternate charsets.

More information here
http://msdn2.microsoft.com/en-us/library/ms524628.aspx

Moderator, this question can be closed.

Please post a close request in the community support TA.
ASKER CERTIFIED SOLUTION
Avatar of Vee_Mod
Vee_Mod
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial