Encoding UTF-8 vs iso-8859-1
-
Hi, I had created an XML file with Unicode (encoding UTF-8) using Word 2007; the problem is when I try to view it in IE through an XSL result in the following error: An invalid character was found in text content... I changed the encoding of XML file to “ISO-8859-1” – able to view in IE but the characters get messed. Please Help. Hariharan C
-
Hi, I had created an XML file with Unicode (encoding UTF-8) using Word 2007; the problem is when I try to view it in IE through an XSL result in the following error: An invalid character was found in text content... I changed the encoding of XML file to “ISO-8859-1” – able to view in IE but the characters get messed. Please Help. Hariharan C
-
Hi, I had created an XML file with Unicode (encoding UTF-8) using Word 2007; the problem is when I try to view it in IE through an XSL result in the following error: An invalid character was found in text content... I changed the encoding of XML file to “ISO-8859-1” – able to view in IE but the characters get messed. Please Help. Hariharan C
Hi, did you try to set the output of your sxl file to utf-8 or iso-8859-1? example:
<xsl:output method="xml" encoding="iso-8859-1" indent="yes" />
otherwise, some more information might be needed to know where the encoding gets messed up.
-
Hi, I had created an XML file with Unicode (encoding UTF-8) using Word 2007; the problem is when I try to view it in IE through an XSL result in the following error: An invalid character was found in text content... I changed the encoding of XML file to “ISO-8859-1” – able to view in IE but the characters get messed. Please Help. Hariharan C
Sometimes when you save a Unicode document, it places a couple of extra bytes at the beginning of the XML file. I usually delete those bytes, and everything seems to work after that.
"We make a living by what we get, we make a life by what we give." --Winston Churchill
-
Hi, did you try to set the output of your sxl file to utf-8 or iso-8859-1? example:
<xsl:output method="xml" encoding="iso-8859-1" indent="yes" />
otherwise, some more information might be needed to know where the encoding gets messed up.
Hi, I tried the following in XML And the following in XSD thanks,. Hariharan C.
-
Hi, I tried the following in XML And the following in XSD thanks,. Hariharan C.
here is a dummy example I made to show the principle. neither dtd nor schema is provided and the xsl is connected in the xml to allow you to open the xml in ie and see the resulting (minimalistic) web page. rem: the location of my xsl file is hard coded in C:\Temp\ both files are saved on disk in utf-8 txt.xml:
<?xml version="1.0" encoding="UTF-8"?&ft;
<?xml-stylesheet type="text/xsl" href="C:\Temp\dummy.xsl"?>
<bla>üöä</bla>dummy.xsl:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" encoding="iso-8859-1" indent="yes" omit-xml-declaration="yes" media-type="text/html"/>
<xsl:template match="bla">
<html>
<body>
<xsl:value-of select="."/>
</body>
</html>
</xsl:template>
</xsl:stylesheet>hope this helps Erik
-
here is a dummy example I made to show the principle. neither dtd nor schema is provided and the xsl is connected in the xml to allow you to open the xml in ie and see the resulting (minimalistic) web page. rem: the location of my xsl file is hard coded in C:\Temp\ both files are saved on disk in utf-8 txt.xml:
<?xml version="1.0" encoding="UTF-8"?&ft;
<?xml-stylesheet type="text/xsl" href="C:\Temp\dummy.xsl"?>
<bla>üöä</bla>dummy.xsl:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" encoding="iso-8859-1" indent="yes" omit-xml-declaration="yes" media-type="text/html"/>
<xsl:template match="bla">
<html>
<body>
<xsl:value-of select="."/>
</body>
</html>
</xsl:template>
</xsl:stylesheet>hope this helps Erik
Thanks Erik, I tried this too, resulting two junk characters instead of Unicode character. Do I need to install any fonts for this? Regards, Hariharan C.
-
Thanks Erik, I tried this too, resulting two junk characters instead of Unicode character. Do I need to install any fonts for this? Regards, Hariharan C.
you have to take care that the files saved on disk are saved in utf-8 format and not in ansi (most text editors will allow you to change) Erik