External Interfaces Previous page   Next Page

Writing Character Data

MATLAB writes character data to MAT-files using Unicode character encoding by default. You can override this setting and use the default character set for your system instead by doing one of the following:

See the individual reference pages for these functions for more information.

You can override this setting for all of your MATLAB sessions using the Preferences dialog box. Open the Preferences dialog and select General and then MAT-Files. Click on Unicode or Local Character Set. See General Preferences for MATLAB in the Desktop Tools and Development Environment documentation for more information.

Converting Character Data

Writing character data to MAT-files using Unicode encoding enables you to share data with users that have systems with a different default system character encoding scheme, without character data loss or corruption. Although conversion between Unicode and other encoding forms is often lossless, there are scenarios in which round-trip conversions can result in loss of data. The following guidelines may reduce your chances of data loss or corruption.

In order to prevent loss or corruption of character data, all users sharing the data must have at least one of the following in common:

As an illustration, if one user on a Japanese language operating system writes ASCII data having more than 7 bits per character to a MAT-file, another user running MATLAB version 6.5 on an English language operating system will be unable to read the data accurately. However, if both had MATLAB version 7, then the information could be shared freely without loss of data or corruption.


Previous page  Reading and Writing MAT-Files Finding Associated Files Next page

© 1994-2005 The MathWorks, Inc.