MATLAB: How to get the MATLAB editor to read UTF-8 characters? UTF-8 characters in blank squares in editors, but in the command window and workspace works fine.

editorencodingutf-8

I have a project, which is commented in UTF-8 characters.
I tried changing the system locale on my Windows 10, however MATLAB editor is not recognizing UTF-8 characters(in blank squares). I'm not sure what to do here.
If I open the same .m file in text editor, it works fine.
How do I get my MATLAB editor to read UTF-8? Thank you
feature('DefaultCharacterSet')
feature('locale')
ans =
UTF-8
ans =
ctype: 'en_US.windows-1252'
collate: 'en_US.windows-1252'
time: 'en_US.windows-1252'
numeric: 'en_US_POSIX.windows-1252'
monetary: 'en_US.windows-1252'
messages: 'en_US.windows-1252'
encoding: 'windows-1252'
terminalEncoding: 'windows-949'
jvmEncoding: 'Cp1252'
status: 'MathWorks locale management system initialized.'
warning: 'System locale setting, ko_KR, is different from user locale settiā€¦'

Best Answer

I have a very tricky way to solve this problem. And it seems works. In my case, (windows matlab 2016b x64)
feature('locale')
always output below even I have modified lcdata.xml
ctype: 'zh_CN.GBK'
...
so, I delete this in lcdata.xml (in codeset)
<encoding name="GBK">
<encoding_alias name="936">
</encoding>
then I change following
<encoding name="UTF-8">
<encoding_alias name="utf8"/>
</encoding>
to
<encoding name="UTF-8">
<encoding_alias name="utf8"/>
<encoding_alias name="GBK"/>
</encoding>
The point is cheat matlab GBK is just alias of utf8
Related Question