Accents issue

Hello all!

I'm testing phpstorm and I love it.

One question though, I don't understand how it handles file encodings : let's say I open a file in Ansi, why does Phpstorm detect it as UTF-8 even if I turn off the auto-detect?
If I add a single space in the file to activate auto-save, it modifies an accent ( é ) in the file to 0xEFBFBD (replacement character).

Any pointers?

Thanks!

6 comments
Comment actions Permalink

Hi Thomas,

After turning off "Autodetect UTF-encoded files" in "Settings | File Encodings" you need to restart PhpStorm for that setting to start working -- http://youtrack.jetbrains.com/issue/IDEA-81492

Also, what do you have for "IDE encoding" (the same screen: Settings | File Encodings)? (I don't think this one will matter in your case -- asking just in case).

0
Comment actions Permalink

Hey Andriy,

Thanks for your answer.
So, I restarted phpstorm but it didn't change much.

A file with an "é" character (0xE9) is displayed as a "?" and still saved as 0xEFBFBD.
If I open the file in Notepad++, it displays the "é" correctly.

The IDE encoding is in UTF-8 (default value). I work with UTF-8 files and ANSI files.

0
Comment actions Permalink

You should be able to manually change file encoding to that file now -- be it in status bar .. or in that "Settings | File Encodings" screen.

If it still does not work for you then please provide simple example of such file (attach it here).

Similar thread (IMO):

0
Comment actions Permalink

Yes, I didn't see that, sorry.

If I manually set the encoding to windows-1252, it works as it should do.



But, isn't there a way for the program to use a best guess?
0
Comment actions Permalink
But, isn't there a way for the program to use a best guess?

It does it already -- quite badly, as you can see (possibly (just a wild guess) it looks at "IDE encoding" and prefers UTF over any other encoding).

I'm sure, if you search Issue Tracker, you will find a ticket or two on this subject already submitted:

0
Comment actions Permalink

I see :)

Thank you for your help!

0

Please sign in to leave a comment.