cancel
Showing results for 
Search instead for 
Did you mean: 

source file is not valid UTF-8 clang (invalid_utf8)

dqsh06
Senior

Hello,

I used vscode with st externsion Ver3.6.4. One day, suddenly, VSCode started showing many red lines and warnings, including "main.h" source file is not valid UTF-8 clang (invalid_utf8).

the file looks like:

dqsh06_0-1765803669010.png

dqsh06_1-1765803805494.png

and many other redlines, because of clangd.

how can fix it?  it makes file very ugly, evenif it can be compiled no error.

Thanks.

 

1 REPLY 1
KnarfB
Super User

Hmm, a freshly created STM32G4 CubeMX project works fine here.

So you might have changed or inserted some non-UTF-8 code snippets?

Using git source control right from the beginning might help detecting such changes.

hth

KnarfB