Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reading special characters from a XML file using VB

Status
Not open for further replies.

JumpStarter

Programmer
Joined
Apr 26, 2003
Messages
7
Location
IN
Hi all,

I have an xml file with a few special characters like "ä" and lots more. These symbols get displayed properly on the browser. But when i try reading them using Visual Basic 6 i get question marks. The xml document follows the "iso-8859-1" encoding format and it does not have any DTD.

Any help would be appreciated

JS
 
Does the document have the encoding explicitly set to ISO-8859-1? Because if it's missing, the XML standard says the default is UTF-8.

Also - How are you reading the file? Are you using a SAX parser or a DOM? Reading XML via Win32 file reads or VB6 file I/O is a sure way to get this problem.

And -- Don't trust the browser to display XML correctly. You need a tool like XMLSpy or a Unicode-aware editor like Unipad.

Chip H.


If you want to get the best response to a question, please check out FAQ222-2244 first
 
Thanks for ur reply Chip.

Yes the document has been set the encoding :
<?xml version=&quot;1.0&quot; encoding=&quot;iso-8859-1&quot; ?>

I am reading the file using Microsoft DOM.

When i try opening the document with XMLSpy i get the following message :
&quot;Your file contains 1 character(s) that should no tbe present in a file using the ISO 8859-1 (Latin-1/West European)encoding. If your proceed, these characters will be replaced by a substitution character in the document window.&quot;

If i remove the encoding then i get boxes in the xml document.

I need to read this data and store them in the database. Do you know anyway to over come this problem..

Thank you in advance
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top