RE: [xsl] How can the encoding of form data be specified in XML/ XSL

Subject: RE: [xsl] How can the encoding of form data be specified in XML/ XSL
From: "Martinez, Brian" <brian.martinez@xxxxxxxxxxx>
Date: Wed, 28 May 2003 10:31:47 -0600
> From: Jeni Tennison [mailto:jeni@xxxxxxxxxxxxxxxx]
> Sent: Wednesday, May 28, 2003 3:03 AM
> Subject: Re: [xsl] How can the encoding of form data be specified in
> XML/XSL
> 
> 
> Hi Carsten,
> 
> > We use XML/XSL in browser to generate some HTML data. XML and XSL
> > uses ISO-8859-1 encoding. In some cases HTML forms are generated,
> > the form data is submited with an URL-encoded get to the server.
> >
> > We found that IE browsers encode the formdata in UTF8 before its
> > URL-encoded. Gecko browser just send ISO-8859-1.
> >
> > Is there a way to enforce a certain encoding of submitted data?
> 
> This is an HTML question rather than an XSLT one, since it's about how
> the browser behaves when it submits a form. You might try using the
> accept-charset attribute on the <form> element to specify the
> character encodings that you're willing to accept. Something like:
> 
>   <form action="filterform.htm" accept-charset="ISO-8859-1">
>     ...
>   </form>
> 
> Having said that, according to the HTML spec, browsers are supposed to
> use the same character encoding when submitting a form as was used for
> the HTML page itself. Perhaps IE is getting confused because you're
> doing the transformation client-side or perhaps it just always submits
> the form in UTF-8; it's hard to say without trying out the above.

In IE 5.5 at least, the default behavior is always to send URLs encoded as
UTF-8.  This can be changed in the Internet Options control panel, under the
"Advanced" tab, in the "Browsing" section.  I'm not sure if there is a way
to override this behavior programmatically; I did notice, however, that your
sample stylesheet lacked an explicit xsl:output element, which causes the
processor to default to XML output encoded as UTF-8.  You might try setting
the encoding of the HTML output explicitly in your stylesheet:

<xsl:output method="html" encoding="iso-8859-1"/>

cheers,
b.

|       please note new address and phone #'s effective may 19        |
| brian martinez                           brian.martinez@xxxxxxxxxxx |
| lead gui programmer                                    303.357.3548 |
| cheap tickets, part of trip network                fax 303.357.3380 |
| 6560 greenwood plaza blvd., suite 400           englewood, co 80111 |
| cendant travel distribution services   http://www.cheaptickets.com/ |

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread