cancel
Showing results for 
Search instead for 
Did you mean: 

UTF-8 source code merge bug at CubeMX Genarate Code

Anju Hirano
Associate II
Posted on October 23, 2017 at 10:16

Hello.

I am troubled with garbled characters of CubeMX's code generation function.

The version of CubeMX is 4.22.1.

The development environment is SW4STM32.

The reproduction method is explained below.

1. Generate the code with CubeMX.

2. Open the project with SW4STM32 and change the character code of the project to UTF-8.

3. Open main.c and add Japanese characters to the USER CODE area.

0690X00000608f1QAA.png

4. Quit SW4STM32.

5. Start CubeMX and generate the code again without changing anything.

6. When SW4STM32 is started and main.c is opened, it can be confirmed that garbled characters are occurring. You can also check garbled characters in the text editor.

0690X00000608cSQAQ.png

From this, I think that CubeMX has the cause of garbled characters.

Is there any workaround?

Best Regards

Yas

#cubemx-4.22
1 REPLY 1
Jeanne Joly
Senior III
Posted on February 08, 2018 at 16:29

Hello

Hirano.Yasuhiro

,

Do you try to open the main.c generated by CubeMX with an text editor you currently use?

I think that the issue does not come from the generated file but comes from SW4STM32 that interprets the main.c and change yourjapanese characters (look at the settings you have in SW4STM32).

There is already a thread where we both intervened (

https://community.st.com/0D50X00009XkYH8SAN

).

Could you please make the try?

BR. Jeanne