[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Escaping a utf-8 string

Subject: Re: Escaping a utf-8 string
From: "Wesley W. Terpstra" <wesley@xxxxxxxxxxx>
Date: Sun, 18 Aug 2002 06:09:56 +0200
rfc822 utf 8
On Sat, Aug 17, 2002 at 07:51:41PM -0600, Mike Brown wrote:
> Wesley W. Terpstra wrote:
> > Well, there is this uri-escape function in xpath 2.0:
> > 	http://www.w3.org/TR/xquery-operators/#func-escape-uri
> > sadly, though, it only came into existence two months ago (Jun 17).
> > 
> > It would be enough since then "translate(escape-uri(str, true), '%', '=')"
> > would give me a suitable string for RFC822 headers when wrapped with
> > =?utf-8?Q?...?=
> > 
> > However, this function doesn't explain very clearly what is done for
> > non-ascii characters; are they represented by a utf-8 stream?
> 
> "The effect of the function is to replace any special character in the string 
> by an escape sequence of the form %xx%yy..., where xxyy... is the hexadecimal 
> representation of the octets used to represent the character in UTF-8."

Ok, wow. Either they already patched it per my email or my brain has a bug.
:-) I didn't see that before.

> Seems clear enough to me, and would be what you want. And you should be able
> to use it reliably in client side processors by 2005 or so.

Yes. I know... Well, hopefully libxml2 will have it within a year. I already
sent a patch adding support for it to the author. As for the other xslt guys
out there, it seems like this would be a nice function to add asap! It
addresses a problem that it seems lots of people (google) have run into.

> > Portability is an issue. :-( The pages are all xml with the intention that
> > then browsers can use different xsl to format them to user taste.
> 
> Some would start laughing at this point. :)

Fine. But, come on! That is the whole point of xsl. :-)

-- 
Wesley W. Terpstra <wesley@xxxxxxxxxxx>

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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.