Unable to save file using US-ASCII encoding. Error keeps popping up.

46 ビュー (過去 30 日間)
Liam Mislej
Liam Mislej 2020 年 3 月 30 日
編集済み: Francesco Wanderlingh 2024 年 2 月 18 日
A friend sent me a simple plot code in matlab, it ran normally untill I changed one parameter, then this error popped up:
Unable to save file using US-ASCII encoding.
Save the file using UTF-8 encoding instead.
I've tried googling the problem but all I found was to change the encoding in the code itself, which isn't possible as I can not run the code. Am using the R2020a version of matlab. Any suggestions?
  4 件のコメント
nan yin
nan yin 2020 年 11 月 14 日
Thank you very much.Vielen danke!
Qingjie Yang
Qingjie Yang 2021 年 8 月 10 日
Thank you @Siqi, it works.

サインインしてコメントする。

回答 (1 件)

Francesco Wanderlingh
Francesco Wanderlingh 2024 年 2 月 18 日
編集済み: Francesco Wanderlingh 2024 年 2 月 18 日
I had a similiar problem, but the error was "Unable to save using windows-1252 encoding".
In my case the error popped up when I inserted the "≥" carachter in a comment of the file, and I suppose is due to the fact that ≥ is a special character, not included in all encodings, while UTF-8 is quite omnicomprehensive and cross-platform safe. Not sure though why that happened for you.
As @Siqi also pointed out in the comments, the solution is to "Save As" the file (instead of just "Save") and select UTF-8 from the drop-down menu in the save dialog.

カテゴリ

Help Center および File ExchangeStartup and Shutdown についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by