RE: [xsl] escaping an accented character

Subject: RE: [xsl] escaping an accented character
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Wed, 14 Jan 2004 09:29:11 -0000
> OK, sorry to be so dense, but your reference says the following:
> 
>    We recommend that user agents adopt the following convention
>    for handling non-ASCII characters in such cases:
>    1. Represent each character in UTF-8 (see [RFC2279]) as 
> one or more bytes.
>    2. Escape these bytes with the URI escaping mechanism 
> (i.e., by converting
>       each byte to %HH, where HH is the hexadecimal notation 
> of the byte 
> value).
> 
> So following the instructions, I take the character for à, 
> which according 
> to everything I can find is 224. I convert this to hex, E0.

Read the instructions again, more carefully. It doesn't say "take the
Unicode codepoint value and express it in hexadecimal". It says
"represent each character in UTF-8", and to be especially helpful it
points you to a definition of UTF-8. The UTF-8 representation of a-acute
occupies two bytes.

Michael Kay

 
> Voila, the 
> escaped value is %E0.  Where do you get %C3%A0 out of this? 
> Obviously the 
> xsl parser agrees with you, but I don't see where the value 
> is coming from.
> 
> Thanks.
> 
> --Peter
> 
> 
> At 10:09 PM 1/13/2004 +0100, you wrote:
> >Peter Hollingsworth wrote:
> >
> >>The character à ('a' with a grave accent) appears in a node 
> in my XML.
> >>When I use an XSLT to display the node in an href for link 
> in an html 
> >>page, the character gets escaped as %C3%A0, which is 
> completely wrong (it 
> >>should be escaped as %E0). Similar problems occur with all 
> accented characters.
> >
> >It's exactly the right thing. See:
> >
> ><http://www.w3.org/TR/html401/appendix/notes.html#h-B.2.1>
> >
> >>Both the XSL and the XML file have encoding="UTF-8" (unicode, I 
> >>believe).
> >
> >That's irrelevant here.
> >
> >>Any suggestions?  Thanks.
> >
> >Fix the server, if you can. The URI is just fine.
> >
> >Julian
> >
> >--
> ><green/>bytes GmbH -- http://www.greenbytes.de -- tel:+492512807760
> >
> >XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> >
> 
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 


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


Current Thread