Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - Cannot return XML with UTF-8 chars with ASP. [Thread Next] Re: Cannot return XML with UTF-8 chars with ASP.To: NULL Date: 10/2/2005 8:13:00 PM Well, it works if I load the string into a DOM object and save the DOM to
the response stream, e.g.
-------------------------------------------
<%@ Language=VBScript %>
<%Response.ContentType="text/xml"%>
<%
Dim objXML
set objXML = CreateObject("MSXML2.DOMDocument.4.0")
objXML.loadXML( "<?xml version=""1.0"" encoding=""UTF-8""?>" & _
"<text>Cost £200</text>" )
objXML.save Response
%>
---------------------------------------
I have no idea why this makes a difference, but who am I to argue with the
DOM?
--Brian
"brb" <b_bertan@h...> wrote in message
news:uBGylL1xFHA.1256@T......
>I am trying to return XML through an ASP page and it simply fails when the
>XML contains characters with ascii value is > 128. While I generate my
>data dynamically, this simple example -- note the currency symbol --
>displays the same error: "An invalid character was found in text content.".
>It displays properly if I use a $ instead of the £
> ------------------------------------------------------------------
> <%@ Language=VBScript %>
> <%Response.ContentType="text/xml"%>
> <%
> Response.Write "<?xml version=""1.0"" encoding=""UTF-8""?>"
> Response.Write "<text>Cost £200</text>" %>
> -------------------------------------------------------------
>
> Thanks,
>
> --Brian
>
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
