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.
Created attachment 110558 [details] Screenshot It seems that XmlFileEncodingQueryImpl.getEncoding returns "UTF-8" for all XML files. I have a project with encoding "ISO-8859-2" that contains an XML file. Editing that file is fine, but when I invoke "Find in Projects" and review matching lines, national characters are displayed incorrectly. If I invoke "Replace in Projects...", the file is damaged (cut after the first national character)! Method getEncoding should return charset "ISO-8859-2" for that file. I'm not sure about the priority, but some data can be destroyed.
I caught myself -- the XmlFileEncQueryImpl.getEncoding *is* supposed to return different values, actually. The proper way is not to ask for encoding in advance, but using CharsetEncoder/Decoder, which find/replace in files failed to do. Now it seems OK, tried on project with UTF-8 encoding, but file was with windows 1250 one (system uses iso-8895-2). Fixed.
Integrated into 'main-golden' Changeset: http://hg.netbeans.org/main-golden/rev/932457b075da User: sdedic@netbeans.org Log: #201869: find/replace did not use Charset decoder properly. Incorrect impl of BufferedCharSequence, did not work with ProxyCharset.
Verified - "Replace in Projects" and "Find in Projects" works fine in project with ISO-8859-2 encoding Product Version: NetBeans IDE Dev (Build 201109260601) Product Version: NetBeans IDE 7.1 Beta (Build 201109252201) Java: 1.7.0; Java HotSpot(TM) Client VM 21.0-b17 System: Linux version 2.6.38-11-generic running on i386; UTF-8; en_US (nb)