How to change encoding of all files at once with Jetbrains IDE like WebStorm
Solution 1
Close every project you have opened by clicking File > Close Project.
Once they are all closed, the startup window will show up (The window with the latest opened projects with the options to open new project, etc..) In that window, at the bottom right corner you have settings.
In Settings > Editor > File Encodings.You can set up all the File Encoding options to UTF-8, it will be added to the new projects from now on.
If you want it for old projects, do the same steps, but access the settings once you have the project open.
I hope this help!
Solution 2
To convert the file encoding, you have to use some external tool to perform the conversion, such as iconv:
iconv -f windows-1252 -t utf-8 <input file> > <output file>
Related videos on Youtube
Vadorequest
https://www.linkedin.com/in/ambroise-dhenain/ CTO at https://unly.org/
Updated on June 04, 2022Comments
-
Vadorequest almost 2 years
For some unknown reason, the encoding of my files has changed without me noticing for a while.
It was
UTF-8
and now iswindows-1252
. I have reset the project encoding fromSettings->File encoding
but I can't detect which files are badly encoded and can't figure out how to reencode all files within the project at once.I have a strong feeling that the problem appeared with WebStorm 10 first released version, but I may be wrong. (I think it's because it set by default the
project encoding
setting towindows-1252
) -
Vadorequest over 8 yearsYeah, it's a solution for a file-by-file basis. Not for all files at the same time. :)