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

Escaping a utf-8 string

Subject: Escaping a utf-8 string
From: "Wesley W. Terpstra" <wesley@xxxxxxxxxxx>
Date: Sat, 17 Aug 2002 20:03:38 +0200
utf 8 email subject
I am sure this is a commonly asked question, but I couldn't find it in the
FAQ: I want to escape an xsl string.

Unfortunately I need the ascii value of the characters in it. I understand
however, that since things are unicode it is not this simple. Fortunately, I
actually want the string as utf-8 and to pop off a character at a time from
the utf-8 string. This way I can write a nice email subject line:

A contrived example:
	=?utf-8?Q?bleh bleh =FD=AC blah blah?=

Where presumably =FD=AC is some valid utf-8 encoding sequence

Also, I would like to be able to encode uris. I know that xfunctions provide
a uri-escape() function, but this is not on my target xsl platforms (IE6 xsl
and libxslt1). Incidently, if this worked I could just
translate(uri-escape(str, true), '%', '=') for the email example and use
uri-escape for the uris I need to deal with.

Again, all would be simple if only I could extract a hexademincal encoding
of the utf-8 string in some way. Getting the ascii numeric value would work,
or in fact, a function like "hexify" or something that takes the string and
just output AB87B3AF873E or something would be fine since I could then stick
=s and %s in the stream appropriately.

Does anyone know of a way to get past this barrier in xsl?

Thanks; this is really important to me.

-- 
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.