Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XML
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 13th, 2004, 12:29 PM
Authorized User
 
Join Date: Dec 2003
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.

 
Old December 13th, 2004, 12:53 PM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
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)
 
Old December 13th, 2004, 01:20 PM
Authorized User
 
Join Date: Dec 2003
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

 
Old December 13th, 2004, 01:34 PM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
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)
 
Old December 13th, 2004, 01:56 PM
Authorized User
 
Join Date: Dec 2003
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

 
Old December 13th, 2004, 02:19 PM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
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)





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 03: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





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.