如何设置代码生成时文件的编码
13 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
leifeng song
el 22 de Sept. de 2025 a las 10:39
Comentada: leifeng song
el 28 de Sept. de 2025 a las 3:25
电脑的语言是中文,使用Simulink搭建的模型,生成代码时,代码文件的编码都为中文编码,我想设置文件编码为UTF8,应该如何设置。
0 comentarios
Respuestas (1)
Esther
el 24 de Sept. de 2025 a las 1:55
You can specify the encoding used for generated code by using the slCharacterEncoding function in MATLAB.
For example, run the following command before code generation:
>> slCharacterEncoding('UTF-8');
After running this, the generated C and H files will be encoded in UTF-8.
Please note that this setting applies for the current MATLAB session.
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!