Unicode development in MATLAB GUI on WIndows and Linux

3 views (last 30 days)
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 Comments
Walter Roberson
Walter Roberson on 6 Mar 2014
Try setting the font explicitly to one you know to have the characters you need.
mabalenk
mabalenk on 10 Mar 2014
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 =
ééé

Sign in to comment.

Answers (1)

Walter Roberson
Walter Roberson on 5 May 2015
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 Comments
Swapna Havalgi
Swapna Havalgi on 6 Nov 2015
Thanks for the response,is this version of MATLAB R2014b works and supports on WINDOWS 7 ultimate 64-bit?
Walter Roberson
Walter Roberson on 8 Nov 2015
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.

Sign in to comment.

Categories

Find more on Dates and Time in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!