登录论坛

查看完整版本 : MATLAB源文件中的Unicode字符


poster
2019-12-14, 20:13
我想在MATLAB (http://en.wikipedia.org/wiki/MATLAB)源文件的注释中使用Unicode (http://en.wikipedia.org/wiki/Unicode)字符。当我写文字时,这似乎可行;但是,如果我关闭文件并重新加载它,“异常”字符将变成问号。我猜MATLAB正在将文件另存为ASCII。

有什么办法告诉MATLAB使用UTF-8 (http://en.wikipedia.org/wiki/UTF-8)代替吗?



回答:

MATLAB流程如何使用语言环境设置 (http://www.mathworks.com/help/matlab/matlab_env/how-the-matlab-process-uses-locale-settings.html)显示了如何为不同平台设置编码。使用

feature('DefaultCharacterSet') 您可以在此处 (http://undocumentedmatlab.com/blog/undocumented-feature-function)阅读有关此未记录功能的更多信息。另请参见此Matlab中央线程 (http://www.mathworks.com/matlabcentral/answers/15423-how-do-i-determine-my-matlab-default-character-encoding-scheme) 。



更多&回答... (https://stackoverflow.com/questions/4984532)