MATLAB: MacOSX encoding problem

charactersencodingmacosxunicodeutfutf-8

[EDIT: 20110626 09:40 CDT – reformat – WDR]
Hello everebody, I have an encoding trouble.
*>> ver*
-------------------------------------------------------------------------------------
MATLAB Version 7.12.0.635 (R2011a)
Operating System: Mac OS X Version: 10.7 Build: 11A511
Java VM Version: Java 1.6.0_26-b03-383-11A511 with Apple Inc. Java HotSpot(TM) 64-Bit Server VM mixed mode
mac console:
DeZhMBP:~ clock$ locale
LANG="ru_RU.UTF-8"
LC_COLLATE="ru_RU.UTF-8"
LC_CTYPE="ru_RU.UTF-8"
LC_MESSAGES="ru_RU.UTF-8"
LC_MONETARY="ru_RU.UTF-8"
LC_NUMERIC="ru_RU.UTF-8"
LC_TIME="ru_RU.UTF-8"
LC_ALL="ru_RU.UTF-8"
It seems to me that UTF8 is a correct encoding for my OS.
MATLAB console:
>> getenv('LANG')
ans =
ru_RU.KOI8-R
OK, trouble is here, I set up a startup.m in my start folder:
bdclose all;
set_param(0, 'CharacterEncoding', 'UTF-8');
slCharacterEncoding('UTF-8');
Restart MATLAB and again:
>> getenv('LANG')
ans =
ru_RU.KOI8-R
I try to set manually:
>> bdclose all;
set_param(0, 'CharacterEncoding', 'UTF-8');
>> getenv('LANG')
ans =
ru_RU.KOI8-R
I can write m-scripts using my native language. Its OK, but command window shows me: -0.0092942 3.0647 . .
I do not understand what should I do to improve it. I need UTF-8 for platform sharing. Any ideas?
Please help.

Best Answer

The MathWorks locale database can be found at the following location and name.
$matlabroot/bin/lcdata.xml
Find the following entry.
<locale name="ru_RU" encoding="KOI8-R" xpg_name="ru_RU.KOI8-R">
<alias name="ru"/>
<alias name="ru_SU"/>
</locale>
Modify as the following.
<locale name="ru_RU" encoding="UTF-8" xpg_name="ru_RU.UTF-8">
<alias name="ru"/>
<alias name="ru_SU"/>
</locale>
That's it.