This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
I've created a java project (maven java application) using UTF-8 with NB8.02, project encoding UTF-8, properties file using UTF-8, too. 1. Already with 8.02, the file has been added as if it has default windows encoding. 2. With 8.02, I had to change encoding to "project encoding", that was all to get it working. 3. After switching to 8.1Beta, the file was no longer assigned "project encoding" - why? => First bug 4. After switching on "project encoding", the file was corrupted: Each single byte of the UTF-8 codes has been turned into a single character, corrupting all non-ascii characters. => Second bug So, there're two bugs: 1. File properties are not passed to the new installation (probably a change in project.xml or project.properties?) 2. File encoding change corrupts characters.
Might be related to #166597
Problem 1) Maven project. But I think that the properties file should not use project encoding as the properties file encoding is either ISO-8859-1 or UTF-8 (1.5+) by spec. Problem 2) In fact it's not a bug. When the file was created in Encoding1 and switched to incompatible Encoding2 the bytes to character mapping may produce garbage. The change of encoding in the project changes how the files are loaded and stored it does not recode any existing files.
Hi Tomas, it seems, there has sth. changed from 8.0 to 8.1 - probably unintendedly. I could change encoding in 8.0 without corruption, the same did not work for me with 8.1. In the meantime, I got the same problem with *.java files, which I copied from a windows-1252-encoded project to one with utf-8-encoding, so (2) is not true. Concerning (1), I wouldn't have changed econding to project one's, if I wouldn't have had a project with utf-8-encoding, but it had been recognized as using platform encoding.
Em, sorry, last sentence is not well understandable - I wanted to say: "... but the _properties file_ had been recognized as using platform encoding."
I was trying to reproduce and everything works fine in default set up. The properties file correctly returns ISO-8859-1 encoding according to spec. The situation changes when you check File Properties/Use Project Encoding. The option is strange as according to spec the properties file can be either ISO-8859-1 or UTF-8. Properties file encoded in other encoding is not a valid properties file. The option is stored as FileObject attribute which is lost during IDE update, if you turn it on you need to do it again in the new installation. The issue is not project related, reassigning.
Hi Peter, regarding the (2) and Java. The IDE never did any file updates when you changed the encoding. Aren't you using "Open In Encoding Plugin" this plugin assigns an explicit encoding to given file which is then enforced. But it's saved in FileObject attribute and has the same problem as the properties file. Can you attach some java file which works in NB 8.0 but not in NB 8.1. I will debug it. If you have both Nb 8.0 and 8.1 you can also run the IDE with -J-Dorg.netbeans.api.queries.FileEncodingQuery.level=FINE and open such a file. The log after opening the file should be similar. Thanks
Hi Peter, had you a time to look for an affected java file? I want to be sure that the issue is not generic before we release NB 8.1. Thanks a lot.
Sorry, I'll not have enough spare time before tomorrow