Hi all,
I have an issue regarding encoding in a XML file. I'm using czech letters like "Č, á, í"... inside a body tag of an XML and the error seems to occur whenever there are letters with acute or circumflex. I'm actually printing some text content into an xml file.
Snippet of the code
When i open this file in some browser, it tells me there is some encoding error at line 5 and show only the ID and date, like a normal string, the name is not included. When I open the file in my notepad, everything seems fine.
Do I need to encode the whole content of the file or the file itself? What to do so it can read the 5th line also and show as a tag in browser?
Thank you
I have an issue regarding encoding in a XML file. I'm using czech letters like "Č, á, í"... inside a body tag of an XML and the error seems to occur whenever there are letters with acute or circumflex. I'm actually printing some text content into an xml file.
Snippet of the code
Code:
Dim xmlContent As String
Dim save As String
xmlContent = "<?xml version=""1.0"" encoding=""UTF-8""?>" & vbCrLf & _
"<Main>" & vbCrLf & _
"<ID>" & Me.ID & "</ID>" & vbCrLf & _
"<Date>" & Now() & "</Date>" & vbCrLf & _
"<Name>" & "ěščřžýáíé" & "</Name>" & vbCrLf & _
"</Main>"
save = "C:...\test.xml"
Open save For Output As #1
Print #1, xmlContent
Close #1
When i open this file in some browser, it tells me there is some encoding error at line 5 and show only the ID and date, like a normal string, the name is not included. When I open the file in my notepad, everything seems fine.
Do I need to encode the whole content of the file or the file itself? What to do so it can read the 5th line also and show as a tag in browser?
Thank you