0

I have to change file encoding in every project to utf-8. It always shows windows-1251 . So how can I change file encoding forever. I tried change in settings IDE Encoding and Project Encoding to utf-8 but it is not working.

1 Answer 1

1

Both encoding settings (IDE-level and project-level) apply for new files created by PhpStorm.

Afaik, PhpStorm does not provide any way to bulk change the encoding of many files at once. You have to open each file, change its encoding from the drop-down menu in the status bar (or menu -> File -> File Encoding) then save it.

To make the things easier you can add a key combination for the File Encoding command (in the Key Bindings section of the Preferences) or record a macro (but it won't save you more key presses).

Sign up to request clarification or add additional context in comments.

3 Comments

"Afaik, PhpStorm does not provide any way to bulk change the encoding of many files at once." It does. Select desired files/folders in Project View and then invoke File | File Encoding. Have not used this myself though (had no need to do that with encoding) ... but it does work like that for changing Line Ending .. so should work here as well.
Indeed, it works. The drawback is that the command is available in the menu when only files are selected in the Project View. It doesn't work for folders.
"You have to open each file, change its encoding from the drop-down menu in the status bar " as I said I have to change every file

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.