Tag Archives: change the default character encoding setting

[Solved] MATLAB/SIMULINK Generate Codes Error: change the default character encoding setting

SIMULINK click to generate C code to report an error
Error message:
Error encountered while executing PostCodeGenCommand for model ‘RTW_sc3’: Close all block diagrams (using ‘bdclose all’) before trying to change the default character encoding setting
Caused by:
Close all block diagrams (using ‘bdclose all’) before trying to change the default character encoding setting

reason:
Caused by not setting the default encoding

 

Solution:


Add these two sentences in the initialization:

currentCharacterEncoding = slCharacterEncoding();
slCharacterEncoding('Windows-1252');