Groups | Blog | Home
all groups > vb.net > may 2004 >

vb.net : XML and unicode


FE-FR
5/18/2004 10:56:25 PM
Hi,

I am currently experiencing a problem reading an XML file wich containts
unicode data, in fact words from foreign language (hebrew, arabic, asian,
....)

The code I am using is very basic :

xmlfile="c:\test.xml"

Set xmlDoc = CreateObject("Msxml2.DOMDocument.4.0")
If xmlDoc.Load(xmlfile) Then
Set Tim = xmlDoc.getElementsByTagName(infos)
TheWord = Tim.Item(0).Text

The header of my XML just containts :

<?xml version='1.0'?>

and the data is (example in hebrew) :
<information>?????</information>
<justForTest>mytext</justForTest>


With this code, if I request 'information', I get ???? in my 'TheWord' var.
If I request 'justfortest', it works fine.

I just wonder why I get this problem and if someone can give me some advice.

Thanks

FE



Mihai N.
5/19/2004 9:35:36 AM
[quoted text, click to view]
advice.
Is you application ANSI?
If yes, then the data from xml (unicode) is converted to ansi code page.

--
Mihai
-------------------------
NM
5/19/2004 4:33:33 PM
Hi,

[quoted text, click to view]

You should specify on the header of your XML file the encoding type :
<?xml version="1.0" encoding="ISO-8859-8" ?>

Regards,

FE-FR
5/19/2004 10:56:24 PM
I am using VB6.

Any idea ?

Thanks
[quoted text, click to view]

AddThis Social Bookmark Button