Introjucer truncated one of my cpp file because of accents


#1

Hello,

 

I updated a graphic component with introjucer then I did a Saveall.

So he saved my whole files, but inside a cpp file I usually never open with introjucer,

there was a comment with a "à" because the comment was in French,

so the file was truncated from the position of the 'à'.  (90% of code has been lost).

 

In another file I had a 'ê' inside a comment, it was replaced by a end of line.

Here of course it wasted nothing, I only needed to put back the line and avoid to write a 'ê'.

 

So, I think French users need to be aware.

 


#2

The code editor expects everything to be UTF-8.

If you feed it a file that was saved in some other local encoding, then since it has no way of knowing htat, it'll stop parsing when it hits some bytes that aren't valid UTF8.

I guess I could add some fallback checks that would force it to carry on parsing after it hits UTF8 errors, but even if it did that, it'd screw up the extended characters.


#3

OK, Thanks.

So my files I open them only with Juce and Visual Studio.

So are there any way to tell Visual Studio to use only UTF8?


#4

If it could help someone here is my method, to avoid messing source files because of encoding:

 

1) I installed "fix file encoding" plugin inside visual studio and I asked he protects every file.

2) inside Introjucer, each time a new .h or .cpp is created, I put a comment with a special character as 'à' for example, at the beginning of the file, and I save it with introjucer.

3) Then, when the file is opened inside visual studio, the file is by default considered as 

    being encoded in UTF8, and I could resave it normally without I need to specify the UTF8 encoding mode each time I save it.