Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > XML > XML
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
XML General XML discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XML section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old December 13th, 2004, 12:29 PM
Authorized User
 
Join Date: Dec 2003
Location: , , .
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default VB6 and XML File with International Characters

Hi,
I am trying to read an XML File which contains French text from my VB6 codes, It doesn't work, although it works perfectly with XML File with English characters.
I use MSXML2.DOMDocument object and use method .Load(filename.xml)
but cannot load the file if XML contains french characters.

Would somebody help me please.

Thanks
M.A.

Reply With Quote
  #2 (permalink)  
Old December 13th, 2004, 12:53 PM
joefawcett's Avatar
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Sounds like the file has been created incorrectly, the actual encoding does not match the stated encoding. Do you know how it was created? Can you open it in IE?

--

Joe (Microsoft MVP - XML)
Reply With Quote
  #3 (permalink)  
Old December 13th, 2004, 01:20 PM
Authorized User
 
Join Date: Dec 2003
Location: , , .
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I saved the file as unicode in notepad. and can open it in IE.
Mishi

Reply With Quote
  #4 (permalink)  
Old December 13th, 2004, 01:34 PM
joefawcett's Avatar
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

In your first post you said you used load(filename.xml), this won't work with any file, you need loadXML. Can you show the actual code you use?

--

Joe (Microsoft MVP - XML)
Reply With Quote
  #5 (permalink)  
Old December 13th, 2004, 01:56 PM
Authorized User
 
Join Date: Dec 2003
Location: , , .
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default


Private m_xmlDoc As MSXML2.DOMDocument

Private Sub LoadTranslationFile(xLanguage As String)

    Dim sFile As String
    Set m_xmlDoc = New MSXML2.DOMDocument

    Select Case xLanguage
        Case "English"
            sFile = m_sRoot & "\Languages\English.xml"
        Case "French"
            sFile = m_sRoot & "\Languages\French.xml"
    End Select

    If m_xmlDoc.Load(sFile) = False Then

        Exit Sub
    End If

end sub

Reply With Quote
  #6 (permalink)  
Old December 13th, 2004, 02:19 PM
joefawcett's Avatar
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Should work, if you like you can email the file to check, I have joefawcett as my hotmail address.

--

Joe (Microsoft MVP - XML)
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
French Characters in XML mansharma_s XML 5 February 9th, 2007 07:38 AM
XML vs. special characters brko C# 1 January 23rd, 2006 11:05 AM
XML escape characters ACE2084 XML 0 September 9th, 2005 04:12 PM
Reading XML file using VB6 godinaraja VB How-To 2 January 11th, 2005 07:18 AM
VB6 and XML File with International Characters mishi Pro VB 6 0 December 13th, 2004 12:27 PM



All times are GMT -4. The time now is 06:14 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.