RE: [xsl] 8bit ascii encoding

Subject: RE: [xsl] 8bit ascii encoding
From: "Andrew Welch" <awelch@xxxxxxxxxxxxxxx>
Date: Fri, 23 Aug 2002 10:28:21 +0100
Hi David, you came back just in time... :)

> however I think you just want
> <xsl:value-of select="translate(.,'&#8216;&#8217;',&quot;''&quot;)"/>
> don't you?

There are tens of 1000's of xml files which could contain any unicode
char, so that isn't an option.

 
> If you don't want to translate the left and right quotes to straight
> ascii quotes, then you should be able to do output &#8216; as &#8216;
> rather than as utf-8 multi byte sequence by using
> <xsl:output encoding ="...."/>
> where .... is an encoding name that
> a) your XSLT processor knows and
> b) does not contain the character 8216.
> ASCII or US-ASCII or iso-8859-1 all satisfy (b) at least.


Yes, I tried this - the theory is that because the reference cannot be
escaped using the current encoding it will get passed through to the
output unchanged, right?

However, the project Im working on hosts IE through a JNI activeX
control.  The result of the transform goes through the JNI string
manipulation code ( in c ) which then gets to IE.  At which point the
encoding seems to be wrong.

The result of the transformations are encoded in utf-8, at this point I
know everything is ok.  They are passed around as a
ByteArrayOutputStream, which is then converted to a BSTR in the c code,
added to, and then passed to IE for rendering.

Do you think that the BOM is going to be affected by this, as the c code
is outputting single byte chars, or does that not matter to IE provided
the <meta> encoding states utf-8? 

more testing I think........


cheers
andrew

> -----Original Message-----
> From: David Carlisle [mailto:davidc@xxxxxxxxx]
> Sent: 22 August 2002 16:30
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: Re: [xsl] 8bit ascii encoding
> 
> 
> 
> > as c only understands 8bit ascii 
> 
> there's a lot of programs written in C that can do more than ascii...
> 
> however I think you just want
> 
> <xsl:value-of select="translate(.,'&#8216;&#8217;',&quot;''&quot;)"/>
> 
> don't you?
> 
> If you don't want to translate the left and right quotes to straight
> ascii quotes, then you should be able to do output &#8216; as &#8216;
> rather than as utf-8 multi byte sequence by using
> <xsl:output encoding ="...."/>
> where .... is an encoding name that
> a) your XSLT processor knows and
> b) does not contain the character 8216.
> ASCII or US-ASCII or iso-8859-1 all satisfy (b) at least.
> 
> 
> 
> David
> 
> _____________________________________________________________________
> This message has been checked for all known viruses by Star Internet
> delivered through the MessageLabs Virus Scanning Service. For further
> information visit http://www.star.net.uk/stats.asp or 
> alternatively call
> Star Internet for details on the Virus Scanning Service.
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 
> 
> 
> 
> 
> ---
> Incoming mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.381 / Virus Database: 214 - Release Date: 02/08/2002
>  
> 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.381 / Virus Database: 214 - Release Date: 02/08/2002
 

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


Current Thread