Why do I receive character incompatibility errors when loading a model in Simulink 6.0 (R14)?

14 views (last 30 days)
It appears I need to set the character encoding using SLCHARACTERENCODING. When I tried to open my model, I received the following error:
ERROR: Warning: Model '...' contains characters incompatible with the current MATLAB
character encoding setting '<character encoding>'.
Please use the 'slCharacterEncoding' command to change the setting to one
of the following encodings:
'Shift_JIS, ISO-8859-1', before loading this model.
Type 'help slCharacterEncoding' for usage information.
I then followed the instructions to get help on SLCHARACTERENCODING.
help slCharacterEncoding
However, I received another error:
ERROR: slCharacterEncoding.m not found.
Use the Help browser Search tab to search the documentation, or
type "help help" for help command options, such as help for methods.
There is no help for SLCHARACTERENCODING. Why is this occurring and what can I do to resolve it?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 10 Dec 2021
Edited: MathWorks Support Team on 13 Dec 2021
This bug has been fixed for Release 14 (R14). For previous releases, please read below for any possible workarounds:
In order for the Simulink to correctly handle strings containing non-ASCII characters, the model loader will pre-scan an MDL-file for non-ASCII characters. If any such characters are found and are inconsistent with the current MATLAB encoding setting, model loading will stop and the warning described above will be displayed.
The SLCHARACTERENCODING function forces Simulink to use a different character encoding than the one that MATLAB is using. If it is likely that the extended characters come from a European character set, use the command:
slCharacterEncoding('ISO-8859-1');
If it is likely that the extended characters come from an Asian character set, use the command:
slCharacterEncoding('Shift_JIS');
This command will only be active for the current MATLAB session. If you will frequently be loading models from a non-ASCII character set, you should place this command in your startup.m file so that it is loaded every time that MATLAB is started. See the following URL for more information on how to do this:
Note that the documentation for SLCHARACTERENCODING command is missing in Simulink 6.0 (R14). The following is the documentation for SLCHARACTERENCODING.
SLCHARACTERENCODING: Change the MATLAB character set encoding.
If you have a model containing non-ASCII characters, you need to change the MATLAB
character set encoding to be compatible with these characters before loading the model.
Currently, we support: US-ASCII, UTF-8, Shift_JIS, ISO-8859-1.
Note: You need to close all open models or libraries before changing the MATLAB
character set encoding except when changing from 'US-ASCII' to another encoding.
Examples:
slCharacterEncoding() % return the current MATLAB character
% set encoding
slCharacterEncoding('Shift_JIS') % change the MATLAB character set encoding
% to Shift_JIS

More Answers (0)

Categories

Find more on Interactive Model Editing 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!