Hello friends,
I am having trouble correctly displaying XML content which I load from an ASP.
My XML is encoded in UTF-8, yet the transformed HTML output is encoded UTF-16!
That, of course, causes all special characters to display as junk.
Can you help me out here?
This is my ASP code handling the XML data:
This is my XML header:
My XSL header:
And the resulting output:
What the hell?
Sure: UTF-8 + UTF-8 = UTF-16, do the math...
Strange things...
Thanks in advance!
Andy
[blue]Help us, join us, participate
IAHRA - International Alliance of Human Rights Advocates[/blue]
I am having trouble correctly displaying XML content which I load from an ASP.
My XML is encoded in UTF-8, yet the transformed HTML output is encoded UTF-16!
That, of course, causes all special characters to display as junk.
Can you help me out here?
This is my ASP code handling the XML data:
Code:
Dim objXML
Dim objXSL
Dim strHTML
'Load the XML File
'determine, which file to load*****
fil= "xml/" & lang & "/" & session("file") & ".xml"
'********
Set objXML = Server.CreateObject("Microsoft.XMLDOM")
objXML.async = False
objXML.load(Server.MapPath(fil))
'Load the XSL File
Set objXSL = Server.CreateObject("Microsoft.XMLDOM")
objXSL.async = False
objXSL.load(Server.MapPath("andy.xsl"))
' Transform the XML file using the XSL stylesheet
strHTML = objXML.transformNode(objXSL)
Set objXML = Nothing
Set objXSL = Nothing
Response.Write strHTML
This is my XML header:
Code:
<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="andy.xsl" ?>
Code:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="[URL unfurl="true"]http://www.w3.org/1999/XSL/Transform">[/URL]
Code:
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=UTF-16">
What the hell?
Sure: UTF-8 + UTF-8 = UTF-16, do the math...
Strange things...
Thanks in advance!
Andy
[blue]Help us, join us, participate
IAHRA - International Alliance of Human Rights Advocates[/blue]