Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Re: Proper encoding [Thread Next] Re: Proper encodingTo: NULL Date: 8/1/2005 8:39:00 AM Thanks for the input, Bjoern! :-) Bjoern Hoehrmann wrote: > * Roshawn Dawson wrote in microsoft.public.xsl: > >>I'm creatin an affiliate site for Amazon.com, and I am having an >>encoding issue in xsl. Given a name that contains the é symbol >>(latin small letter e with acute), how do I properly encode it? >> >>For instance, Amazon.com encodes the symbol as %E9 while in xsl it is >>encoded as %C3%A9. How can I have it done Amazon's way, > > > Please make sure %E9 is what you really need; this encoding is based on > ISO-8859-1 which can't encode many characters (like the euro symbol or > japanese "characters"), %C3%A9 would be the proper way here, this is > based on UTF-8 which does not have the problems cited above. That said, > all you need is encode the string to a byte array using the ISO-8859-1 > encoding first, and then replace octets > 0x7F by their %xx equivalent. > If you use the .NET Framework, the System.Web.Uri class has methods for > this purpose. For XSLT you'd need to have this code in an extension > function (or a complicated template), I don't think there is any other > means available since the XSLT standard requires the results you get. | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
