Android Question Special Caracter in list don't work help

Luis Miguel T. Martins

Member
Licensed User
Longtime User
Help please, I have a big problem, I make a sub, this sub return a line in a list, this is my translator in my app because this list read a text file and after send the value to the captions (texts) but in portuguese have special caracters how ç á ã â and the sub return a Crazy caracter with a "?" in all special caracters

B4X:
Dim list1 as List

...

Sub lang(line As Int) As String

line=line-1


list1.Initialize
list1=File.ReadString(File.DirDefaultExternal,"portuguese.txt")

Return(list1.Get(line))

End Sub


In the txt file for example have the word "coração"
the basic4android return "cora??o"

thanks
 
Last edited:

Luis Miguel T. Martins

Member
Licensed User
Longtime User
This work:


B4X:
Dim lines As List   
Dim tr As TextReader

...

Sub lingua(l_number As Int) As String
 l_number=l_number-1
 tr.Initialize2(File.OpenInput(File.DirDefaultExternal, "english.txt"), "ISO-8859-1")
 lines = tr.ReadList
 tr.Close


 'return the line text with ç á ü ƒ etc

 Return(lines.Get(l_number))

End Sub
 
Upvote 0
Top