How can I display Russian Cyrillic characters in a figure in MATLAB 7.7 (R2008b)?

20 views (last 30 days)
I want to add a TITLE or a TEXT object in my figure to display a Russian Cyrillic text string. I am using Finnish locale settings on Windows:
>> slCharacterEncoding
ans =
windows-1252
All I see is question marks or empty squares when executing these commands:
textInRussian = '??????' title(textInRussian)

Answers (1)

Doug Hull
Doug Hull on 13 Jan 2011
You need to change the locale setting.
Your locale setting is Finnish and these setting supports windows-1252 codeset on Windows. It does not support Russian characters, and therefore, Russian characters are not properly handled.
MATLAB does not support Unicode. This means supported characters are limited. Supported characters are determined based on the current locale setting at run-time. The windows-1252 is the one you chose. If you would like to properly display Russian characters, a locale, which supports windows-1251, should be specified.
There are several locales, which support windows-1251, and Russian locale is one of them. In previous versions, MATLAB used the system locale to handle character code conversion. MATLAB 7.7 (R2008b) uses the user locale. User locale and system locale must be the same value. If these values are not the same, you may see garbled text or incorrect characters.
On Windows, you control the following locale settings: • user locale • system locale The instructions below describes how to set locale on Windows platforms:
User Locale Setting:
Windows Vista 1. Select Start -> Control Panel -> Regional and Language Options 2. Open Formats tab 3. Select an item from the drop-down list
Windows XP 1. Select Start -> Control Panel -> Regional and Language Options 2. Open Regional Options tab 3. Select an item from the drop-down list
Windows 2000 1. Select Start -> Control Panel -> Regional Options 2. Open General tab 3. Select an item from the drop-down list
System Locale Setting When you change the locale, you must reboot your system; otherwise, you may see unexpected locale-setting behaviors.
Windows Vista 1. Select Start -> Control Panel -> Regional and Language Options 2. Open Administrative tab 3. Click Change system locale... button 4. Select an item from the drop-down list 5. Reboot the system
Windows XP 1. Select Start -> Control Panel -> Regional and Language Options 2. Open Advanced tab 3. Select an item from the drop-down list 4. Reboot the system Windows 2000 1. Select Start -> Control Panel -> Regional Options 2. Open General tab 3. Click Set default... button 4. Select an item from the drop-down list 5. Reboot the system
------------------------------
Another workaround, especially when you do not have administrator rights to change the settings is the following. Install the freeware font called Mac C Swiss on any Windows System. To access it in MATLAB for a uicontrol for example just type in:
>> uicontrol('fontname','Mac C Swiss', 'string','kak dela')
or when you would like to work with CHAR
>> uicontrol('fontname','Mac C Swiss','string',char(200))
  1 Comment
Walter Roberson
Walter Roberson on 22 Jan 2011
Matlab *does* support Unicode
http://www.mathworks.com/support/bugreports/287611
"The command window supports unicode fonts"; "figures support only 8 bit graphics"
http://www.mathworks.com/help/techdoc/rn/f8-1009921.html#f8-1011931
In Release 14, this limitation is removed by adopting the Unicode character encoding scheme in mxArrays and their storage in MAT-files.

Sign in to comment.

Categories

Find more on Programming 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!