Android Question UTF-8 / windows-1251

micheleBr

Member
Licensed User
Longtime User
Good morning,
I'm trying to read an xml file, in the file there are cyrillic chars.
Using the code below, in the variable "xmlTest" I can not read/see the original text (cyrillic).
B4X:
Dim TextReader1 As TextReader
    TextReader1.Initialize(File.OpenInput(File.DirAssets, "test_xml.xml"))
    Dim xmlTest As String
    xmlTest = TextReader1.ReadAll 
    TextReader1.Close

Does anyone know how to solve this problem?
(I attach the source files)
tnx in advance!!
 
Last edited:

micheleBr

Member
Licensed User
Longtime User
here the solution:
B4X:
Dim tr As TextReader
    tr.Initialize2(File.OpenInput(File.DirAssets, "test_xml.xml"), "Windows-1251")
    Dim s As String
    s = tr.ReadAll
tnx!
 
Upvote 0
Top