[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 418
  • Last Modified:

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?
  • 2
1 Solution
Michel PlungjanIT ExpertCommented:
Try £
RichardPogsonAuthor Commented:
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

Moderator, this question can be closed.

Michel PlungjanIT ExpertCommented:
Please post a close request in the community support TA.
Closed, 500 points refunded.
Community Support Moderator

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now