Thanks for this.  Unfortunately, I must be barking up the wrong tree.  The
.NET server still decoded the Request.Form collection UTF8 no matter what I
set the charset to on the XML post.  And '%A9' is decoded to an empty string
on UTF8.

I guess I could write my own method to replace the javascript "escape" to
make it .NET friendly, but that would kind of suck.

JK

-----Original Message-----
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Dan G. Switzer, II
Sent: Monday, April 30, 2007 7:32 AM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: UTF-7 Ajax form


Jeffrey,

>I'm having some troubles with extended characters (copyright symbol, etc.)
>being submitted to the server as a part of a CMS I am writing.
>
>For example, the javascript "escape" command will convert the copyright
>symbol to %A9.  However, the server receiving the ajax POST needs to see
>that as UTF-7 before it will correctly interpret it.
>
>Is there anyway to add the "charset=utf-7" header to the ajax call?  And if
>not, is there a better way to handle this?

The Accept-Charset header should be controlled by the browser and webserver.
You may need to make sure your app/web server is responding to pages using
UTF-8.

You can set custom headers by using the beforeSend mapping:

$.get(
        {
                url: "someurl.htm",
                beforeSend: function (xml){
                        xml.setRequestHeader("Accept-Charset",
"ISO-8859-1,utf-8;q=0.7,*;q=0.7");
                }

        }

)

I'm not sure how well that will override the charset in various browsers
though, since that's a header automatically added by the browser.

-Dan


Reply via email to