Getting some unknown characters like blank squares in my MATLAB files .

10 ビュー (過去 30 日間)
Saaketh Ramachandra Puligadda
Saaketh Ramachandra Puligadda 2024 年 4 月 18 日
編集済み: cui,xingxing 2024 年 4 月 27 日
I'm currently engaged in a project that necessitates the inclusion of multilingual characters, such as Chinese or French, within my MATLAB code for comments and other purposes.
Previously, I was utilizing MATLAB 2022b without any issues. However, after upgrading to MATLAB 2023a, I've encountered difficulties incorporating these characters.
Whenever I attempt to include Chinese or French characters, I find that blank squares or question marks are rendered within the MATLAB file instead of the intended characters. I suspect that this issue might be attributable to the update.
Could someone kindly offer assistance or guidance on resolving this matter? Any insights or suggestions would be greatly appreciated.
  2 件のコメント
Pavan Sahith
Pavan Sahith 2024 年 4 月 18 日
Can I know the encoding being used , changing the encoding will help
Saaketh Ramachandra Puligadda
Saaketh Ramachandra Puligadda 2024 年 4 月 18 日
How to know the information about encoding?

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

採用された回答

Pavan Sahith
Pavan Sahith 2024 年 4 月 18 日
Hello Ramachandra,
It appears that MATLAB is not identifying French or Chinese characters correctly and question marks or boxes are appearing instead, it could be due to the incorrect encoding being used. To get a better understanding of the current locale settings in MATLAB, you can use the command:
feature('locale')
Generally, setting the encoding to 'UTF-8' should solve this issue. For that you can try the following steps:
  • In MATLAB, Use "Save As" to save the file.
  • The saving box that comes up will have a menu that allows you to select the format of the file to save as.
  • Make sure that UTF-8 is selected and not "all .m files".
You can also refer to the following link to change the encoding to UTF-8
Hope the above information helps.
  1 件のコメント
Saaketh Ramachandra Puligadda
Saaketh Ramachandra Puligadda 2024 年 4 月 18 日
Thanks for the reply ,the link helped me to change the encoding to UTF-8.
I also checked my current encoding details using "feature('locale')", it wasn't UTF-8 before.

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

その他の回答 (1 件)

cui,xingxing
cui,xingxing 2024 年 4 月 18 日
編集済み: cui,xingxing 2024 年 4 月 27 日
Save the file that was displayed correctly in R2022b as a new file, note that the type is "utf-8", and then it should be displayed correctly in later versions.
-------------------------Off-topic interlude-------------------------------
I am currently looking for a job in the field of CV algorithm development, based in Shenzhen, Guangdong, China. I would be very grateful if anyone is willing to offer me a job or make a recommendation. My preliminary resume can be found at: https://cuixing158.github.io/about/ . Thank you!
  3 件のコメント
cui,xingxing
cui,xingxing 2024 年 4 月 18 日
編集済み: cui,xingxing 2024 年 4 月 18 日
Saaketh Ramachandra Puligadda
Saaketh Ramachandra Puligadda 2024 年 4 月 18 日
Thanks for the reply , it helped me changing the encoding of my current file to UTF-8 .

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

カテゴリ

Help Center および File ExchangeInstall Products についてさらに検索

タグ

製品


リリース

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by