Why won't the editor display Chinese characters?
43 次查看(过去 30 天)
显示 更早的评论
I can't figure out how to get the editor to display Japanese characters. If I enter the following in the command prompt:
'yyyy年 MM月 dd日'
The interpreted value returns as:
ans =
yyyy MM dd
The Chinese characters are ignored. This seems like unusual behavior to me. Even worse, if I save the text string in a file and re-open it, the Chinese characters are replaced by '?' marks. Is there a work-around for this?
1 个评论
Oleg Komarov
2016-12-26
Try the following solution: https://uk.mathworks.com/matlabcentral/answers/280988-how-do-i-get-my-matlab-editor-to-read-utf-8-characters-utf-8-characters-in-blank-squares-in-editors
回答(4 个)
zahid jamal
2019-11-28
i just found other solution for that, you need open your code open with notpad++ and it will show you all other language comments
NOTE; i will not work with simple notepad ,,, so you need Notepad++
Link for the Notepad++ https://notepad-plus-plus.org/downloads/
2 个评论
Walter Roberson
2016-8-29
编辑:Walter Roberson
2016-8-30
See also the "Internationalization" section of the R2016a release notes (currently at http://www.mathworks.com/help/matlab/release-notes.html#bu7uzdt )
3 个评论
Gerald
2016-9-28
"Those Chinese comments in a M-file became strange symbols after re-open in Matlab Editor (even anyelse editors). The problem lies in the setting of "Standards and formats" setting of "Regional and Language Options". Set it to "Chinese (PRC)" and then the problem solved. Thus, it seems that Matlab read location information from this section and determine the lunguage with which it displays and stores contents."
1 个评论
Paul McKenzie
2017-5-23
I'm not Chinese and I'm afraid that setting my locale to 'China (PRC)' will have all sorts of unintended (and undesired) consequences. How do I set a 'locale' that uses UTF-8 in U.S. English?
Kin Sung Chan
2022-12-13
Well, I use VSCode to open the Matlab .m file, and resave with GBK encoding. (bottom right button of the VSCode interface next to Spaces) (Well, I try with different types of encoding, and only this one works)
After that, Matlab can display the Chinese characters with no issues.
2 个评论
Zhibin Deng
2023-5-17
well, I tried this method. Not working for me. Every time I reopen the file, the enconding format changed backed into UTF-8.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Characters and Strings 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!