Android Question reading arbic text file

khwarizmi

Active Member
Licensed User
Longtime User
Hi all;
I use this code to read an Arabic text file line by line, but I got Strange symbols and question marks Instead :
Dim Reader AsTextReader
Reader.Initialize(File.OpenInput(File.DirAssets, "arb.txt"))
Dim line AsString
line = Reader.ReadLine
DoWhile line <> Null
ListView1.AddSingleLine(line)
line = Reader.ReadLine
Loop
Reader.Close
How can I fix that ????
 
Try the following edited version of your code (I just corrected some typos)

<code>
Dim Reader As TextReader
Dim listview1 As ListView
Dim line As String
Reader.Initialize(File.OpenInput(File.DirAssets, "arb.txt"))
line = Reader.ReadLine
Do While line <> Null
listview1.AddSingleLine(line)
line = Reader.ReadLine
Loop
Reader.Close
</code>
 
Upvote 0
thank you all, my mistake was the encoding of the file, now I have saved then file with the encoding UFT-8 and the problem was solved !
 
Upvote 0
Back
Top