Yahoo YUI Connection Charset Data Corruption Problem

Posted on 2007-08-07
Last Modified: 2008-02-07
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?
Question by:RichardPogson
    LVL 75

    Expert Comment

    by:Michel Plungjan
    Try £
    LVL 1

    Author Comment

    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.

    LVL 75

    Expert Comment

    by:Michel Plungjan
    Please post a close request in the community support TA.
    LVL 1

    Accepted Solution

    Closed, 500 points refunded.
    Community Support Moderator

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Join & Write a Comment

    In Part 1 ( we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
    Read about why website design really matters in today's demanding market.
    Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
    This video teaches users how to migrate an existing Wordpress website to a new domain.

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    25 Experts available now in Live!

    Get 1:1 Help Now