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 use in all my project the code page UTF-8. When I want to compare a file with a similar one by the funtion Dif To..., the second file is not opened in the correct code-page. I expect, that it is openec in Win 1250. I have to close the IDE, open the previous version (6.5) and perform the comparing in that version.
What project does the second file belong to? AFAIK files are opened with the encoding specified by the project owning that file. And if no such project exists the system default encoding is used. Could you please be more specific about the projects and files that you are using? Thanks
It is only another package in the same project. I prepare a series of programs for students. Each package for one lesson. I needed to compare two versions in different packages. However, as I said, in NetBeans 6.5 it works fine. By the way: I thing it would be fine to be able to set the codepage of the file out of project. E.g. I work on Windows and I have almost no file in the windows' native 1250 codepage.
I can reproduce it as well, but it seems that in 6.5 it worked only "by accident" Here are steps I've done: 1) create new project, UTF-8 encoding 2) create new class and type accented letters 3) switch to win-1250 4) create new class and type accented letters 5) close both files 6) use 'diff' -> in 6.5 both files are opened in correct encoding (probably the 1st document is cached somewhere, it was opened while project was set to utf- 8) -> in dev build both files has wrong encoding 7) open both files 8) use diff -> 6.7 and dev: one file is opened correctly (it's encoding matches project encoding) the another has problems with accents
In general mixing up files with different encoding in the same project is not supported. However, there are file types that support file-level encoding (eg. XML, HTML, JSP, ...). Unfortunately, majority of file types have no way of supplying text encoding.
The problem si, that all my files are encoded in UTF-8, however NB uses this encoding only for files incorporated in the projects with this encoding set. It would be fine, to be able to tell NB, that for all files, even that ones openend directly from random part of the disk, my default encoding is the UTF-8 independently on the encoding preferred by the OS in use.
Did you tried to start the IDE with different enconding than OS default? Maybe -Jfile.encoding=UTF-8 parameter could help you. Regards
(In reply to comment #6) > Did you tried to start the IDE with different enconding than OS default? Maybe > -Jfile.encoding=UTF-8 parameter could help you. The switch is -J-Dfile.encoding=UTF-8 and you can either use it on the command line or add it to your <nb-inst>/etc/netbeans.conf file. It will change the default encoding on the JVM-level. You can double check that the default encoding was indeed changed by looking at the Netbeans -> About dialog or in <ide-userdir>/var/log/messages.log file.