cancel
Showing results for 
Search instead for 
Did you mean: 

[BUG REPORT] Code generation messes up some UTF characters in user code sections

Kazimierz Król
Associate III

I am using some UTF-8 characters in my code that shows messages to the user, and some of them get converted to some other code page when I regenerate the code. This happens when generating code both from CubeIDE ioc editor and CubeMX.

This is how my code looks before generation:

0693W00000Y7SuRQAV.pngAnd after generation:

0693W00000Y7SubQAF.png 

The characters �?, Ę and Ń get messed up.

CubeIDE version: 1.11.0

CubeMX version: 6.7.0

1 ACCEPTED SOLUTION

Accepted Solutions
Rim LANDOLSI
ST Employee

Hi Kazimierz Król ,

Thank you for your contributions and for your detailed explanations.

The issue has been reported to STM32CubeMX development team.

Internal ticket number: 142800 (This is an internal tracking number and is not accessible or usable by customers).

I will keep you posted with updates, and I hope that this answered your question.

When your question is answered, please close this topic by choosing Select as Best. This will help other users find that answer faster.

 

Regards,

Rim

View solution in original post

3 REPLIES 3
Rim LANDOLSI
ST Employee

Hello Kazimierz Król,

Thank you for reporting this issue !

The C standard depends on the compiler and how it copes with the various character sets.

In gcc, you should be able to override the default (UTF-8) encoding using the -fexec-charset switch

Invocation (The C Preprocessor) (gnu.org)

You might be able to use ASCII or some of the charsets listed here libiconv - GNU Project - Free Software Foundation (FSF).

Regards,

Rim

Thank you for the suggestions. I have already used other character encodings, but for this project I want to use UTF-8 specifically. CubeMX should not interfere with that.

Rim LANDOLSI
ST Employee

Hi Kazimierz Król ,

Thank you for your contributions and for your detailed explanations.

The issue has been reported to STM32CubeMX development team.

Internal ticket number: 142800 (This is an internal tracking number and is not accessible or usable by customers).

I will keep you posted with updates, and I hope that this answered your question.

When your question is answered, please close this topic by choosing Select as Best. This will help other users find that answer faster.

 

Regards,

Rim