unicode support in builtin editor
古いコメントを表示
I've been happily using Matlab since release 4 (back in 1996), both in windows and in linux, without complains. However, still in 2012, seems that the mac version still lacks a basic feature like proper unicode support. Does anyone know how to properly display unicode characters in the builtin editor in mac osx? I'm using matlab 7.10.0.499 (R2010a) on osx lion (10.7.2). This can't be so hard, or can it be? Thanks in advance. Best regards, Juan
2 件のコメント
Juan Cardelino
2012 年 1 月 17 日
LUO fei
2020 年 4 月 10 日
Change MATLAB character set encoding
slCharacterEncoding();
slCharacterEncoding change the MATLAB character set encoding to the one you specify.
Using this syntax to change the current MATLAB character set encoding to be compatible with
the characer encoding of a model that you want to use.
'US-ASCII'
'Windows-1252'
'ISO-8859-1'
'shift_JIS'
'UTF-8'
Example
lsCharacterEncoding()
lsCharacterEncoding('UTF-8')--for Chinese
回答 (2 件)
Walter Roberson
2012 年 1 月 16 日
I do not have the Mac version to test with.
The Linux version appears, in my testing, to accept UTF-8 encoded .m files; e.g. I can store Thai with no difficulty. When byte sequences such as the ones for Tibetan are pasted in to the MATLAB editor on Linux, the execution-time recovery of the bytes is correct.
This doesn't answer about Mac, but it would be interesting to see what the MAC version did with such a file.
disp('பாமரராய் விலங்குகளாய், உலகனைத்தும் இகழ்ச்சிசொலப் பான்மை கெட்டு,')
5 件のコメント
Juan Cardelino
2012 年 1 月 17 日
Walter Roberson
2012 年 1 月 17 日
I am using MATLAB R2008b on Ubuntu 10.04, with the environment variables
LC_NUMERIC=C
LANG=en_CA.UTF-8
It appears that we may be using the old X11 library, oldX11lib in place of ubuntu's "accelerated" version (which I gather does not follow X11 semantics properly in some places.)
I have my preferences set to use Monospaced 10 font for the editor, and "Use system font" for desktop display.
A lot of squares is not necessarily wrong; it can just mean you do not have the characters in your present font.
Walter Roberson
2015 年 5 月 5 日
Follow up: testing on OS-X Yosemite,
disp('பாமரராய் விலங்குகளாய், உலகனைத்தும் இகழ்ச்சிசொலப் பான்மை கெட்டு,')
outputs blanks
Walter Roberson
2018 年 10 月 4 日
Follow up: Testing on OS-X El Capitan in R2018b,
disp('பாமரராய் விலங்குகளாய், உலகனைத்தும் இகழ்ச்சிசொலப் பான்மை கெட்டு,')
outputs same it shows it on the command line, which is not exactly the same as is shown here (some of the dots are moved, some of the characters are slightly different shape, there is a bit of odd cursor positioning at one point.)
Subnote: R2018b is not actually supported on El Capitan, but I have not had any difficulties other than talking to the GPU.
LUO fei
2020 年 4 月 10 日
Change MATLAB character set encoding
slCharacterEncoding();
slCharacterEncoding change the MATLAB character set encoding to the one you specify.
Using this syntax to change the current MATLAB character set encoding to be compatible with
the characer encoding of a model that you want to use.
'US-ASCII'
'Windows-1252'
'ISO-8859-1'
'shift_JIS'
'UTF-8'
Example
lsCharacterEncoding()
lsCharacterEncoding('UTF-8')--for Chinese
MathWorks Support Team
2021 年 2 月 19 日
0 投票
As of R2020a, the MATLAB Editor supports UTF-8 characters.
カテゴリ
ヘルプ センター および File Exchange で Introduction to Installation and Licensing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!