Vsfa


Hello,

Here is my issue.
In an excel sheet, I fill in several cells which contain text.

This text can be either in english / french / spanish / italien / german, which means I can have characters like "e" or "e" etc...

In a vba macro I'm trying to put all these data into an XML, this XML is then processed later on by an ASP.net app I have created (using an xmlreader).

The thing is, when I try to display the value of each node of my XML with my ASP.net app, some characters are replaced by squares.
For example, characters like "-", "...", singlequote

BUT, characters like "e" and "e" are perfectly displayed.

And when I have a look into my XML file with Visual Studio I can clearly see all my characters.

Everything is fine.

However, when I try to save the file in VS, it warns me "that some unicode characters can't be saved in the current codepage. Do you want to resave the file as Unicode in order to maintain your data "

If I click "YES" it then set the Xml Encoding to : UTF-16

And from now on, everything is displayed correctly in my ASP.net app.

Here is the VBA Code which generates my XML File.


Code Snippet
Open strPath & cstStudyName & ".xml" For Output As 1

Print #1, "< xml version=" & Chr(34) & "1.0" & Chr(34) & " encoding=" & Chr(34) & "ISO-8859-1" & Chr(34) & " >"
Print #1, "<root>"
iCurLine = cstiStartLine
While objSheet.Cells(iCurLine, cstiVarCol).Value <> ""

strValue = objSheet.Cells(iCurLine, iEnglisCol)

Print #1, "<" & objSheet.Cells(iCurLine, cstiVarCol) & " label= " & Chr(34) & CheckContentsXML(strValue) & Chr(34) & "/>"

iCurLine = iCurLine + 1
Wend
Print #1, "</root>"
Close #1

As you can see, I have tried to specify "ISO-8859-1" in the XML header. If I specify "UTF-8" then xmlreader is generating an error at the first weird character it encounters such as "-"

If I try to specify "UTF-16", it then becomes a bunch of unreadable characters and my ASP.net display nothing.

Does anyone have an idea

Thanks a lot.