Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PhpStorm: Converting folders encoding to another

I have project, where are lots of files in ISO-8859-15 and I need to convert them to UTF-8. If I change one file, it asks "Do you want to convert - plaplapla", if I say yes, important symbols wont become ???.

However, since my project file amount is HUGE, I cannot do that one by one. Changing encoding settings from project settings, it might change encoding to utf-8 but all the symbols will become ??? (thus no conversion).

So, how can I tell PhpStorm to convert all files into utf-8? Is it possible and if yes, how? What is the alternative method?

like image 325
Elven Avatar asked May 21 '15 10:05

Elven


1 Answers

AFAIK it's not possible to do this for whole folder at a time .. but it can be done for multiple files (e.g. all files in certain folder):

  1. Select desired files in Project View panel
  2. Use File | File Encoding
  3. When asked -- make sure you choose "convert" and not just "read in another encoding".

You can repeat this procedure for each subfolder (still much faster than doing this for each file individually).


Another possible alternative is to use something like iconv (or any other similar tool) and do it in terminal/console.

like image 124
LazyOne Avatar answered Sep 29 '22 15:09

LazyOne