External libraries encoding


I have an utf8 project which use iso-8859-1 external libraries, can i set the good encoding for these libraries ?


Comment actions Permalink

Hi there,

"Settings | File Encodings" is for project files only.

If you want to use this particular functionality (where you can define custom encoding for whole folder and all subfolders/files will automatically inherit it) then instead of External Libraries you can add it as additional Content Root (Settings | Directories) -- this will make such folder part of the actual project.

If you cannot use Content Root approach (for whatever reason) then you can still apply custom encoding to such external files BUT on per-file basis only (you have to open such file and assign custom encoding (via status bar or "File | File Encoding")).

Another idea (have not tested this myself, so not sure if it will actually work this way) -- you may set Project Encoding (at Settings | File Encodings) to "iso-8859-1" and assign "UTF-8" to the actual project files. This way any external files should be by default treated as iso-8859-1 encoded.

Comment actions Permalink

Thx, it helps !
I found a way : i set the project in ISO-8859-1 and I check "autodetect UTF-encoded files"


Please sign in to leave a comment.