Netbeans lacks ability to set per file encoding. My projects use two different encodings at the same time, I'm unable to
work with some files.
This is really needed! Also, it's no harsh at all to implement such thing.
I get old sites that mix windows, ISO and UTF-8 encodings, and sometimes I need to use Dreamweaver (!!) to change the
characters on the files, to UTF-8 to ISO, or windows to UTF-8
You can use the encoding plugin:
Well, I've tried the plugin, and it doesn't fit at all...
It allows to open or save a file in another charset. That's enough for conversion but...
What would be needed is a system similar to the one of Eclipse :
in the Project view, the properties of a folder should at least allow to select a charset that will be recursively
considered as overloading the default one.
And that would make the "properties" view of a file/folder useful.
Honestly, as our projects, in their own charset, contain a SVN externalized common core in UTF8, that we're all
brought to modify from time to time, that's the only thing that restrain a lot of people here from using NetBeans,
instead of an IDE able to manage multiple charsets.
*** Bug 228072 has been marked as a duplicate of this bug. ***
Is it possible to make this work like notepad++?.
I think it's the best way to manage file encodings, to choose how to read and how to convert, without breaking the file to open, as does the netbeans.
I have a project where properties files are encoded in ISO-8859-1, as required by Java APIs, and JSON files for web content encoded in UTF-8... Being unable to choose an encoding as per folder / file basis is a real pain as I have to switch from Netbeans to another editor to handle this, and merge conflict resolution concerning these files is a real nightmare.
I would say the priority on this enhancement request should be reviewed and increased.
We have a Java web-project that uses UTF-8 encoding everywhere, however removing the '<%@page contentType="text/html; charset=UTF-8" session="true"%>' line from the start of included JSP files causes them to immediately be converted into some other encoding, losing any and all special symbols.
None of the described workarounds I could find solve this. I moved to Netbeans, because Eclipse crashed crashed almost every time I debugged anything. Switching between two IDEs depending on the hourly needs is not a solution.
It's a huge problem also for me.
I can't port many web projects to Netbeans from Eclipse because this projects use both files UTF-8 encoded and ISO-8859-1 files.
So I'm forced to use Netbeans only for those projects I'm 100% sure there will be only 100% files with the same encoding! :(
I was even trapped in a worse siuation. I have a maven java web project including some files out of maven constraint. The charset of the project is setted to UTF-8 and all the files are in UTF-8. But when I open some css and js files, NetBeans just warn me that it can't be opened in GBK(my local charset) and ask me whether to continue or not. Although java files can be correctly opened in UTF-8.
I think it's neccesary to add a feature that allows you to set the default charset in NB editor, not always local charset. Or when it found it's a bad idea to open a file in local charset, just let me choose which charset to use rander than let me click continue button and show me the file in mess.
I tried to write some plugins but never try to modify the IDE itself. Is there any quick reference about the NB editor?
Until they fix this problem there are 2 workarounds (very workarounds :-) ):
- Open the files with a different charset with another external editor
- Use Eclipse (no problems with projects with mixed charsets)
If Bugzilla allowed me to unload all my votes on a single bug, I would do it on this one because is actually a huge problem. I have to deal with 2 IDEs, will the problems involved (remembering shorcuts and stuff), just, exclusively because of this bug.
"will the problems involved"...
"with all the problems involved"
*** Bug 190236 has been marked as a duplicate of this bug. ***
*** Bug 255109 has been marked as a duplicate of this bug. ***
It happens quite often that a Java Maven project also includes other source files (like SQL, .bat/.cmd, CSV etc).
They are in the same project in order to be tagged/released at the same time as Java files, because they must have the same life cycle.
When these files do not have the same encoding as the one specified in Maven, Netbeans is not able to read them correctly
I'm a strong NB supporter, but it's kind of embarrassing that NB can't handle projects with multiple file encodings. I use NB at work instead of JBoss Dev Studio that everybody else is using because it's just so much better (Eclipse and I don't get along), but having to use another editor to handle certain files with different encoding is really annoying! ... and it makes promoting NB kind of futile =/
I've seen comments to older bug reports on this issue saying that javac requires all Java files to have the same encoding. Still true (I think), but there are lots of other files in our projects, like JS for example!