I have an issue here. Currently, I made research on how to convert the encoded of .xml file from ANSI to UTF-8 and luckily and I found the solution. But there is one problem. My .xml file contain many Spanish language and of course, there is many inverted question mark symbol. In order for eclipse able to perfectly shown all the character in the .xml file, I need to change the encode of the .xml file from ANSI to UTF-8. I manage to change the encoded. But its weird. Even after change the encoded, the contain itself show the unknown character. Below is my code:
Dim objFso, objF As Object
Set objFso = CreateObject("Scripting.FileSystemObject")
xmlFile = NewFolderName & "\" & Application.Cells(5, j + 1).Value
Set objF = objFso.CreateTextFile(xmlFile, True, False)
objF.Write "<resources>"
objF.WriteBlankLines (1)
i = 11
Var = Application.Cells(8, j + 1).Value
Do Until Application.Cells(i, 2).Value = 0
objF.Write " <string name=" & Chr(34) & Application.Cells(i, 2).Value & Var & Chr(34) & ">" & Application.Cells(i, j + 1).Value & "</string>"
objF.WriteBlankLines (1)
i = i + 1
Loop
objF.WriteBlankLines (1)
objF.Write ("</resources>")
objF.Close
Set stream = CreateObject("ADODB.Stream")
stream.Open
stream.Type = 2
stream.Charset = "utf-8"
stream.LoadFromFile xmlFile
stream.SaveToFile xmlFile, 2
stream.Close
Set stream = Nothing
The output from above code is as shown below:
<string name="BroadcastFailed">No se recibi� emisi�n [E202]</string>
<string name="NoInputSelect">No hay selecci�n de entrada disponible</string>
<string name="ThreeDModeQ">�Ver en Modo 3D?</string>
above .xml output is encoded in UTF-8 but unknown characters still appear. What I want is like this:
<string name="BroadcastFailed">No se recibió emisión [E202]</string>
<string name="NoInputSelect">No hay selección de entrada disponible</string>
<string name="ThreeDModeQ">¿Ver en Modo 3D?</string>
anyone who knows what is the error in my code, please drop down your answer. I really appreciate your answers :):)