How to generate a file with ANSI encoding in MATLAB (specifically appdesigner)?
12 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hello,
I am trying to generate a file with ANSI encoding through MATLAB appdesigner. I can do it in the UTF-8 encoding, but I cannot do it with ANSI. I need some characters from ANSI that is necessary. Thanks for the help in advance!
0 Commenti
Risposte (1)
Walter Roberson
il 15 Apr 2025
Modificato: Walter Roberson
il 15 Apr 2025
[fid, msg] = fopen(FileName, 'w', 'n', 'US-ASCII');
Note that US-ASCII only covers the first 128 characters (0 to 127), and that subset is the same as the first 128 characters of Unicode and UTF-8. If you were to use
[fid, msg] = fopen(FileName, 'w');
and simply not write any characters beyond 127, then the resulting file would be the same as US-ASCIIl.
... If you just happen to mean ANSI instead of ASCII, then that is not well defined, but you could open with 'Windows-1252' as a good guess.
0 Commenti
Vedere anche
Categorie
Scopri di più su Data Import and Analysis in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!