Android Question Problem with accented words reading a .txt file

Discussion in 'Android Questions' started by FERNANDO SILVEIRA, Apr 20, 2018.

  1. FERNANDO SILVEIRA

    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?


    Code:
    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
     

    Attached Files:

  2. DonManfred

    DonManfred Expert Licensed User

    Use notepad++ to edit the file.
    [​IMG]
    Change the encoding to UTF8.
    Test with the new file
     
    Erel, coslad, Mahares and 2 others like this.
  3. FERNANDO SILVEIRA

    FERNANDO SILVEIRA Active Member Licensed User

    Don... It worked saving with UTF-8 but I also had to remove/add once again the .txt file to the project, otherwise the effect was the same.

    Thank you very much.
     
  4. kisoft

    kisoft Active Member Licensed User

    I have a similar problem and I found the answer. Thank you too DonManfred.
     
    Last edited: Apr 21, 2018
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice