MATLAB COMPILER RELEASE NOTES User's Guide Page 215

  • Download
  • Add to my manuals
  • Print
  • Page
    / 716
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 214
Desktop Tools and Development Environment
7-5
window containing these characters, you can type the characters, but if you display the
contents of the variable, the characters are corrupted.
Or if you share MATLAB text files with a user on a computer with different locale
settings, they might see corrupted text. The characters are rendered in that user’s locale,
not the language it was written in.
MATLAB text files include scripts and user-defined functions and classes. MATLAB
displays characters in a text file using an encoding scheme, which is defined in the
MathWorks locale database. This encoding scheme supports characters for the language
specified by the user locale setting. If you try to use non-7-bit ASCII characters in a text
file, you might have to use a different encoding scheme. UTF-8 is often used to handle
multilingual characters. Beginning in R2011b, to handle non-7-bit ASCII characters, you
can change the default encoding scheme to UTF-8 by switching the MathWorks locale
database. Note that changing the default encoding scheme might cause characters other
than 7-bit ASCII characters in existing text files to be garbled.
See How the MATLAB Process Uses Locale Settings for more information.
How to Change MATLAB's Default Encoding to UTF-8
If you have text files containing non-7-bit ASCII characters, you must convert the
encoding in the files before changing the default encoding on your computer. For
instructions, see “How to Convert Text File Encoding to UTF-8” on page 7-6.
You can change the default encoding scheme on Mac OS X platforms by using the UTF-8
locale database found in the matlabroot/bin folder.
To change the default locale database, type:
mldir = fullfile(matlabroot,'bin');
copyfile(fullfile(mldir,'lcdata.xml'),...
fullfile(mldir,'lcdata_default.xml'));
copyfile(fullfile(mldir,'lcdata_utf8.xml'),...
fullfile(mldir,'lcdata.xml'));
Alternatively, you can change the default locale database by setting an environment
variable on your computer.
1
Set the environment variable, MWLOCALE_LCDATA_FILENAME, with the UTF-8
version of the locale database name, lcdata_utf8.xml, in the environment file,
environment.plist. Please see this article from the Mac OS X Developer Library,
Page view 214
1 2 ... 210 211 212 213 214 215 216 217 218 219 220 ... 715 716

Comments to this Manuals

No comments