Set Locale on Microsoft Windows Platforms
MATLAB® reads the user locale and system locale on Windows® platforms. The user locale and system locale must be the same value. If these values are not the same, you might see garbled text or incorrectly displayed characters.
MATLAB does not support every locale setting. If your locale is not supported,
MATLAB uses the default locale en_US_POSIX.US-ASCII
, also
known as C locale.
When you change the system locale, restart your system. Otherwise, you might see unexpected behaviors.
Locale on Windows 10 Platforms
These instructions are based on Windows 10 Version 1809. Refer to your version of Windows 10 documentation for information about setting region information using the Settings app.
From Time & Language, select Region.
Under Related Settings, select Additional date, time, & regional settings.
Select Region to change location.
On the Formats tab, select a target locale from the Format drop-down list, and then click Apply. This action sets the user locale.
On the Administrative tab, click Change system locale....
Select a target locale from the Current system locale drop-down list. This action sets the system locale.
Exit each dialog box by clicking OK.
Restart the system.
Using UTF-8 on Windows 10 Platforms
As of Windows 10 1803, Microsoft® added the ability to specify UTF-8 as the character encoding used by Windows itself. This feature can be enabled using the instructions shown above, however, after step 6, select the check box next to Use Unicode UTF-8 for worldwide language support. If this setting is enabled, MATLAB uses UTF-8 as both its default and its locale-specific character encoding.
Note
It is not necessary to enable this option in order to use UTF-8 with MATLAB. MATLAB uses UTF-8 as the default encoding independent of this setting. Therefore, most users do not need to enable this Windows option; however, MATLAB works correctly if it is enabled.
Locale on Windows 7 Platforms
User Locale
Select Start > Control Panel > Clock, Language, and Region > Region and Language.
Open the Formats tab.
Select a target locale from the Format drop-down list.
System Locale
Select Start > Control Panel > Clock, Language, and Region > Region and Language.
Open Administrative tab.
In the Language for non-Unicode programs section, click Change system locale....
Select a target locale from the Current system locale drop-down list.
Restart the system.