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.
Product Version = NetBeans IDE Dev (Build nbms-and-javadoc-5070-on-100412) Operating System = Windows 7 version 6.1 running on x86 Java; VM; Vendor = 1.6.0_18 Runtime = Java HotSpot(TM) Client VM 16.0-b13 I start IDE with opened PHP project. Last opened file has UTF-8 encoding. Opened after IDE restart it contains invalid characters, reopening the file helps. Writing the file irreversibly breaks it (all non-ASCII characters are replaced by invalid ones). Problem existed with older versions of NB too.
Most likely FileOwnerQuery fails to find the project at the time when the editor is opened. I'm not sure where the problem lies or how exactly it should be fixed. Maybe, opening editors should wait until all projects are opened.
I need steps to reproduce the problem from scratch in order to have any hope of diagnosing the bug.
*** Bug 152975 has been marked as a duplicate of this bug. ***
I think you need: - close IDE with big list of opened projects - and opened file with non UT - and Welcome page should be disabled => during "Opening Projects..." phase no project yet is loaded, but file is already opened and incorrect encoding is used I think we shouldn't wait till project is completely opened. It's better to remember encodings of opened files instead
Bug 152975 has some details
There is only one way I can reproduce such a problem: on Linux (UTF-8 default encoding), made a j2seproject, set enc to windows-1250, created an external dir and set it as an extra source root, made a class in that source root containing 'int řehoř;' and saved it (stored on disk as if 'int øehoø;' in ISO-8859-1, as expected), closed project, reopened that file using File > Recent File, restarted IDE with editor window open, and saw it as 'int øehoø;'. (The main window title also failed to show the project name with that editor window focused.) It seems that SimpleFileOwnerQueryImplementation.serialize works correctly but the preferences are not persisted because the IDE is shut down too soon afterward; that can be corrected by having it also flush preferences: core-main #dcf8db9adf82 (Might be cleaner to have NbPreferences flush itself at shutdown, but I was unable to get this to work using Runtime.addShutdownHook; nothing happened unless I ran in a debugger in which case it was fine.) If others know of other problems which can be reproduced in the Java IDE, please file them separately with complete steps to reproduce from scratch.
Integrated into 'main-golden', will be available in build *201004210200* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/dcf8db9adf82 User: Jesse Glick <jglick@netbeans.org> Log: #184310: flush preferences after serializing external owners.