Unicode development in MATLAB GUI on WIndows and Linux

조회 수: 2 (최근 30일)
mabalenk
mabalenk 2014년 3월 5일
댓글: Walter Roberson 2015년 11월 8일
Can anyone please direct me in the Unicode development of MATLAB GUI over Windows and Linux platforms? My problem is the erroneous display of Unicode (French) characters in GUI and *.m files. Once I keep the development to one platform (e.g. Windows) and do all my programming in Windows all Unicode text in GUIs and *.m files is displayed correctly. But as soon as I switch to Linux all Unicode characters present on Windows turn into squares. The same happens in the opposite direction (Linux --> Windows). For the development I use standard MATLAB editor.
Contents of my Windows \Documents\MATLAB\startup.m file are:
feature('DefaultCharacterSet', 'ISO-8859-1');
  댓글 수: 4
Walter Roberson
Walter Roberson 2014년 3월 6일
Try setting the font explicitly to one you know to have the characters you need.
mabalenk
mabalenk 2014년 3월 10일
I'm setting the default fixed width font to Courier on Linux. But even the sprintf() function is unable to print the Unicode characters. Please see the example below:
set(0, 'FixedWidthFontName', 'Courier')
sprintf('ééé')
ans =
ééé

댓글을 달려면 로그인하십시오.

답변 (1개)

Walter Roberson
Walter Roberson 2015년 5월 5일
While using the original handle graphics, MATLAB GUIs and plots cannot display any code point beyond unicode 255, except for the ones you can generate with tex or latex.
HG2 (Handle Graphics 2) is active from R2014b onwards. I do not have any information on what characters it can generate.
What can be displayed at the command line depends upon the DefaultCharacterSet chosen and upon the LANG environment variable and possibly on some other similar settings. On MS Windows it can also depend upon the operating system language settings.
On Mac OS-X, I operate with feature('DefaultCharacterSet') as 'ISO-8859-1', and with environment variable LANG set to en_CA.ISO8859-1 . The code sample tested by mabalenk in comments above works without problem on my system:
set(0, 'FixedWidthFontName', 'Courier')
sprintf('ééé')
ans =
ééé
but that is for output to the console, and it works because the input characters ééé have unicode code points below 65535 (indeed, those particular characters are at codepoint 233 which MATLAB can display even for plots and GUIs.)
  댓글 수: 2
Swapna Havalgi
Swapna Havalgi 2015년 11월 6일
Thanks for the response,is this version of MATLAB R2014b works and supports on WINDOWS 7 ultimate 64-bit?
Walter Roberson
Walter Roberson 2015년 11월 8일
R2012b was the last MATLAB that was supported on original Windows 7. However, all versions since then (up to the present R2015b) are supported on Windows 7 (any edition) with Service Pack 1.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Dates and Time에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by