How to generate a file with ANSI encoding in MATLAB (specifically appdesigner)?
조회 수: 14 (최근 30일)
이전 댓글 표시
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
답변 (1개)
Walter Roberson
2025년 4월 15일
편집: Walter Roberson
2025년 4월 15일
[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
참고 항목
카테고리
Help Center 및 File Exchange에서 Data Import and Analysis에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!