slCharacterEncoding(encoding) specifies
the character set used in the code generated from Simulink® models. The character set encoding affects the comments in the
generated code.
Suppose that you generate code for an embedded target and the
compiler you use requires that the source code contain only
ASCII characters.
Use this command:
slCharacterEncoding('US-ASCII')
Suppose that you have a model that contains
non-ASCII characters (multilingual characters, special
symbols) and you want these annotations to be easily readable in your generated
code.
If your compiler supports UTF-8, on Windows®, use this command:
slCharacterEncoding('UTF-8')
UTF-8 is the default encoding on Linux® and Mac.
Suppose that your model contains Japanese text but your
machine is configured for an English-language locale. You want to generate code
with 'Shift_JIS' encoded text so that your team members who
use 'Shift_JIS' as their locale-specific encoding can see the
Japanese text in the generated code.
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window.
Web browsers do not support MATLAB commands.
Website auswählen
Wählen Sie eine Website aus, um übersetzte Inhalte (sofern verfügbar) sowie lokale Veranstaltungen und Angebote anzuzeigen. Auf der Grundlage Ihres Standorts empfehlen wir Ihnen die folgende Auswahl: .
Sie können auch eine Website aus der folgenden Liste auswählen:
So erhalten Sie die bestmögliche Leistung auf der Website
Wählen Sie für die bestmögliche Website-Leistung die Website für China (auf Chinesisch oder Englisch). Andere landesspezifische Websites von MathWorks sind für Besuche von Ihrem Standort aus nicht optimiert.