Android Question Problem with accented words reading a .txt file

FERNANDO SILVEIRA

Active Member
Licensed User
Hello guys,

I'm reading words from a .txt file to a list but some accented words are replaced by a "?".
Is there something I have to do in order to preserve the original accented words?

I read some threads about UTF8 conversion. Do I have to byte-convert each caracter or is there an option applied while reading the file that does the trick?


B4X:
Dim lstWords1, lstWords2 As List
lstWords1 = File.ReadList(File.DirAssets, "tabpalavras.txt")
Log(lstWords1)

Resulting data read from the file:

(ArrayList) [AVI�O, BOLA, CASA, COPO, DADO, FACA, FLOR, FOGO, FOTO, GATO, LE�O, MALA, MENINA, MENINO, QUEIJO, SUCO, TREM, X�CARA, C�MARA]

Regards,
Fernando
 

Attachments

  • APP04 JogoDasPalavras.zip
    9.3 KB · Views: 264

DonManfred

Expert
Licensed User
Longtime User
Use notepad++ to edit the file.
step065.png

Change the encoding to UTF8.
Test with the new file
 
Upvote 0

kisoft

Well-Known Member
Licensed User
Longtime User
I have a similar problem and I found the answer. Thank you too DonManfred.
 
Last edited:
Upvote 0
Top