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 am using UTF-8 encoded source files. After using 'Replace in Projects', NetBeans (Build 200905051401) sometimes improperly using ascii encoding after replacing (the replace itself is fine), so the UTF-8 characters shows ugly in the editor. When the problem occurs, the only solution is to exit the IDE, and re-start it (closing the file and re-opening it not solves the problem).
Could you please describe in steps what you do so that we can replicate the problem? Also please attach your <ide-userdir>/var/log/messages.log file. Thanks
Created attachment 81728 [details] step1
Created attachment 81729 [details] screens+log
I can not replicate the error (it firstly occurred weeks ago, and this is the second case), but I am attached screenshots from the error, hope this helps.
thanks for screen shots
Thanks for the files and your info, but I'm afraid that without being able to reproduce this we will not be able to fix it.
Today I used the 'Replace In Projects' function again, and the first impression was that everything is okay. But after closed the files, and reopened them, I recognized that Netbeans saved the files in ansi encoding, not in UTF-8. An other problem is, when opening a file from 'Include Path', Netbeans opens them as ANSI, not UTF-8, so the problem may be there (two project was open when replacing, but one of them is in the Include Path of the other project).
Created attachment 91314 [details] testcase I have created a testcase, it seems to be reproducing the error 100% of the cases. I am on Windows XP SP3. Unzip to C:\ root folder. It creates two php projects, and a directory with the two NB projects. One of the php projects is a framework, and the error is related to the include path. 1. Open the project (and only that project) utf8_test_project 2. Ctrl+click on '::world()' Result: hello.class.php opens with strange characters. 3. Close the file 'hello.class.php' 4. Close and reopen NB. 5. Open the project 'utf8_test_project_framework' (leave open the other project too) 6. Ctrl+click on '::world()' Result: OK (it's still OK, after restarting NB) 7. Close 'hello.class.php' and 'index.php' 8. Close the project 'utf8_test_project_framework' 9. Restart NB 10. Open index.php, and ctrl+click on 'world()' Result: strange characters again
Thanks for the testcase. I'll try to reproduce the problem on my laptop and see if we can find what's going wrong. In the meantime CCing tmysik, who could know offhand how FileEncodingQuery works for (closed) PHP projects.
Umm, it seems to be working fine in my 6.8dev build. Could you please try this in some of the later 6.8 builds? If this is fixed in 6.8, but you still need to use 6.7 for some reason, I think you could work around this issue by adding -J-Dfile.encoding=UTF8 to your <nbinst>/etc/netbeans.conf among the netbeans_default_options=. This option will set the default encoding at the JVM level (eg. IDE wide) to UTF8. You can verify that the setting works by looking at the Help -> About dialog, which shows the default encoding and locale used by the IDE.
(In reply to comment #10) Thanks for the workaround, it is fixing the issue! Product Version: NetBeans IDE Dev (Build 2009-11-19_09-04-03 ) Java: 1.6.0_16; Java HotSpot(TM) Client VM 14.2-b01 System: Windows XP version 5.1 running on x86; UTF8; hu_HU (nb) Userdir: C:\Documents and Settings\Styu\.netbeans\dev (before the fix, it was Cp1250)
I assume that this has been fixed long time ago and is no longer a problem. If that's not correct (ie. can still be reproduced in recent 6.9dev builds), please reopen. Thanks
Created attachment 103274 [details] File before using Replace in Projects command
Created attachment 103275 [details] File after using Replace in Projects command
I use NetBeans IDE 7.0 Beta (Build 201011152355) now I'm not sure may I change NetBeans version in the ticket or no and I'm not sure is it good to continue this ticket or it's better to create a new one but nevertheless I have similar bug in 7.0 beta. What is the bug: When I use Replace in Projects comman all russian text which was in cp1251 became ???? ???? ?????? in the top of html file disappears some quite big part about 117 lines!!!! How to reproduce this bug: 1. Create a new project with "File before using Replace in Projects command" (attached) inside, make sure that encoding of this project is setted to cp1251 and set it as a Main Project. 2. Open Replace in Projects dialog and enter as containg text: id="menu_main" as replace with: class="menu_main" Set scope to Main Project and press Find. After getting list with search results press Replace button and you will get "File after using Replace in Projects command" (attached).
I have just re-ran my old test-case on Netbeans 7.0 Beta OS Independent ZIP version (PHP only) with default settings, and I got the same error as before (on the first run). However with the -J-Dfile.encoding=UTF8 config parameter everything is fine. Product Version: NetBeans IDE 7.0 Beta (Build 201011152355) Java: 1.6.0_16; Java HotSpot(TM) Client VM 14.2-b01 System: Windows XP version 5.1 running on x86; Cp1250; hu_HU (nb) Userdir: C:\Documents and Settings\Styu\.netbeans\7.0beta My OS is Windows XP SP3 Hungarian (the same installation as before, but I will test it on an other PC tomorrow).
I have ran my test-case on an other PC, and the same issue here (on the first run, so it's 100% reproducible). You need only the first two step to see the error, so there is no need to restart NetBeans at all (just uncompress the zipped NetBeans, run it and open the `utf8_test_project` only). Product Version: NetBeans IDE 7.0 Beta (Build 201011152355) Java: 1.6.0_18; Java HotSpot(TM) Client VM 16.0-b13 System: Windows XP version 5.1 running on x86; Cp1250; hu_HU (nb) Userdir: C:\Documents and Settings\István\.netbeans\7.0beta XP SP3 Hungarian
I'm on Windows 7 SP1, Italian version and I have this problem too. Very annoying, I'm writing a PHP project and I have a lot of characters like è, à, ù, ò and they all get messed up when I replace a word using the Replace feature, and even worse with the Replace In Project one.
I am suffering from the same bug. The project default encoding is ISO-8859-2 but my Selenium tests are encoded in UTF-8. The Selenium tests show 2 characters instead of a single UTF-8 one, but thats okay, the editor is obeying the Project Defaults. When I use Replace in Projects on my Selenium tests, those pairs of characters are converted to a single question mark. This pretty much screws up my Selenium tests. I'm not even replacing these encoded characters. I'm only replacing ANSI strings. Some of my XML files contain Polish characters. XMLs are encoded in ISO-8859-2 so they are displayed correctly. However, if I use Replace in Projects, the output XML is getting cut on the first occurrence of a Polish character. I even specify encoding in the XML document itself via <?xml version="1.0" encoding="ISO-8859-2"?> but I assume it doesn't and shouldn't affect the Replace in Projects feature.
I can only reproduce encoding problems with XML files, other file types work fine for me. Problems with XML are described in bug 201869.
Works well in current daily build (201109180600). Please reopen if any encoding problems occur again.