Recognizing special characters such as "ç" or "ã"

I'm using textread to read a word list written with Portuguese specific characters (such as "ç" or "ã"). Unfortunately, Matlab seems not to recognize such characters - in reads 'mundializa??o' or alike instead of "mundialização" (I do not know why, since in older versions I do not had this problem). Any clue about what I have to to do solve this situation?
Thank you very much.

3 comentarios

Stephen23
Stephen23 el 14 de Jun. de 2022
Editada: Stephen23 el 14 de Jun. de 2022
C = readcell('test.txt')
C = 1×1 cell array
{'ãbçd'}
S = readlines('test.txt')
S = "ãbçd"
T = fileread('test.txt')
T = 'ãbçd'
Please upload a sample data file by clicking the paperclip button.
Luis Faisca
Luis Faisca el 14 de Jun. de 2022
Editada: Luis Faisca el 14 de Jun. de 2022
Thank you - I just added a "teste.txt" file with Portuguese words with special characters. Please, check. What my Matlab prints is
{'abafadi?o' }
{'abal?vel' }
{'abalroa??o'}
Luis Faisca
Luis Faisca el 14 de Jun. de 2022
Perhaps this could be an idiosyncrasy of the "textread" function. If I use the "readcell" function, as you suggested, special characters are recognized.
Thank you for help, I will proceed with "readcell".

Iniciar sesión para comentar.

Respuestas (0)

Productos

Versión

R2022a

Preguntada:

el 14 de Jun. de 2022

Comentada:

el 14 de Jun. de 2022

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by