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.

Bug 97878 - Use FileEncodingQuery
Summary: Use FileEncodingQuery
Status: VERIFIED FIXED
Alias: None
Product: utilities
Classification: Unclassified
Component: Search (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Marian Petras
URL:
Keywords:
Depends on: 42638
Blocks: 71197 97848
  Show dependency tree
 
Reported: 2007-03-14 17:20 UTC by Tomas Zezula
Modified: 2007-10-20 17:30 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tomas Zezula 2007-03-14 17:20:42 UTC
The search should use the FileEncodingQuery to read the files in correct encoding.
It should do something like:

final Charset c =
FileEncodingQuery.getEncoding(this.getDataObject().getPrimaryFile());
final Reader r = new InputStreamReader (primaryFile.getInputStream(), c);
try {
    search (r);
} finally {
    r.close();
}
Comment 1 Marian Petras 2007-03-23 14:40:24 UTC
Already done.

See issue #71197 ("Wrong encoding for Find & Search") for details.
Comment 2 Ken Frank 2007-10-15 22:43:47 UTC
Marian,

I think it can be verified - here are my steps - let me know if it makes sense as regards this fix:

- have projects that use both utf-8 and euc-jp project encoding.
- find using mbyte characters in each - both projects are found since in this case I think the same characters
are valid in euc-jp and utf-8; perhaps some chars not valid in euc that are valid in utf-8 are needed

- have a previous j2se project in euc-jp that was changed to iso-8859-1 encoding - in this case the characters
are not found now, which makes sense since those characters are not part of the iso-8859-1 charset.

ken.frank@sun.com

Comment 3 Marian Petras 2007-10-16 13:03:29 UTC
Ken, your check makes sense. Thank you.
Comment 4 Ken Frank 2007-10-20 17:30:32 UTC
verified.