xml - vbscript tries to read RSS feeds have issue of System does not support the specified encoding -


i trying use client's url shows feeds on our site. problem having appears application written in java, , encoding of xml response iso8859_1, encoding not supported msxml active x object. please see link reference: http://support.microsoft.com/default.aspx?scid=kb;en-us;q304625.

the problem is, highly doubt able change, or request change encoding of response xml. there work around this?

code

function getxmldom(purl)         set getxmldom = server.createobject("msxml2.domdocument")         getxmldom.async = false         getxmldom.setproperty "serverhttprequest", true         getxmldom.load(purl)  end function 

it first display of headers seem fine. error:

error code 1072896658 reason system not support specified encoding. system error: -1072896658.

if navigate same url in browser, displays xml document fine.

can please suggest solution same

thanks, rohit

i highly doubt able change, or request change encoding of response xml.

well, it's broken. the iana says canonical name iso-8859-1 iso-8859-1. , iso8859_1 not legal alias it. practice internet citizenship, should request change. point out it's broken, , ask fix. practice citizenship, client should fix bug.

iso8859_1 name used, think, within java library code, name mapped iso-8859-1. usage fine, although don't understand need mapping. there people assumed internal name java uses encoding name - not true. alias known java. , erroneous belief spread other libraries , frameworks outside of java assumed incorrectly if java using iso8859_1 encoding name, must right. bottom line iso8859_1 should not used in actual xml documents iana encoding string expected.


in meantime...

if navigate same url in browser, displays xml document fine.

that's not get. using rss source:

<?xml version="1.0" encoding="iso8859_1"?> <rss version="2.0">   <channel> <title>feedforall sample feed</title> <description>rss fascinating technology. ....</description>  ... 

i result in ie8:

alt text

to read in vbscript, need replace iso8859_1 iso-8859-1 . pretty easy using serverhttprequest object.

function urlget(url)     set xmlhttp = createobject("msxml2.serverxmlhttp.6.0")     xmlhttp.open "get", url, false     xmlhttp.send     '' treat output plain text. know may broken.     urlget = xmlhttp.responsetext end function   dim url url = "http://localhost/misc/broken.rss"  '' above url starts xml declaration of ''    <?xml version="1.0" encoding="iso8859_1"?> '' ... invalid, because iso8859_1 not valid '' name xml encoding.  dim urltext urltext = urlget(url)  '' replace encoding think should urltext = replace(urltext,"encoding=""iso8859_1""","encoding=""iso-8859-1""")  set doc1 = createobject("msxml2.domdocument.6.0") doc1.async = false doc1.preservewhitespace= false ' true doc1.loadxml(urltext) 

Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -