"Martin Honnen" <ma*******@yaho o.deskrev i en meddelelse
news:OR******** ******@TK2MSFTN GP05.phx.gbl...
>
Peter Kirk wrote:
>I am trying to exexute a transform (XslCompiledTra nsform .Transform), but
get this exception:
System.Text.En coderFallbackEx ception: Unable to translate Unicode
character \u2013 at index 3637 to specified code page.
What output encoding are you trying to transform to? It sounds as if the
result tree contains the Unicode character with hex code 2013 '-' (decimal
8211) and that character is not contained in the code page you want to use
(e.g. with <xsl:output encoding="ISO-8859-1"or XmlWriterSettin gs) so
serializing the result tree with the desired encoding fails.
Well see, I know virtually nothing about these aspects. I have been supplied
with an xslt file which contains this line:
<xsl:output method="text" encoding="iso-8859-1"/>
I have written a method which accepts an xml string (which consists of data
extracted from a database), and tries to transform this xml to csv format
using an xslt file (supplied by someone else). Could the problem be in the
"encoding" specified in the xslt? Or is it the xml data? What can I do to
avert the exception?
The transformation works with some data, but fails with other data. So it
appears there are some characters in some data which the transformation/xslt
cannot handle, but I don't really know where a fix for this should reside.
Thanks,
Peter