I’m trying to read xml file from vbs script. Xml is encoded in utf-8 and has appropriate header
From vbs script I use microsoft xmldom parser to read xml:
Dim objXMLDoc
Set objXMLDoc = CreateObject( "Microsoft.XMLDOM" )
objXMLDoc.load("vbs_strings.xml")
Inside xml I’m trying to write character by code using &#nnn; notation. Then I read this character from vbscript and try to get it’s code using Asc() function. For some characters it works fine and read code is equal to one written. But for some characters Asc() always returns code 63. What could it be?
Examples:
If xml contains <section>Ã<section> and in script I have Section variable for representing this xml node then code:
Asc(Section.Text)
will return value 195 and it’s ok.
If xml contains <section>n<section> then code:
Asc(Section.Text)
will return value 110 and it’s ok.
But if xml contains <section>‚<section> or <section>œ<section> or <section>Œ<section>
Asc(Section.Text)
will return value 63 and it’s definitely not good.
Do you know why?
The code points decimal 130, 156, and 140 do not correspond to any character in the Unicode character set (123-192 are not defined). The default character mapper that Asc is using will map such errors to ? which is character 63. What characters do think these code points map to?
I suspect that the codes you want are:
‚œandŒ