XML and unicode

F

FE-FR

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
 
M

Mihai N.

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.
Is you application ANSI?
If yes, then the data from xml (unicode) is converted to ansi code page.
 
N

NM

Hi,
The header of my XML just containts :

<?xml version='1.0'?>

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

Regards,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top