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.
Summary: | I18N - "Binary File Detected" check ignores encoding | ||
---|---|---|---|
Product: | platform | Reporter: | err <err> |
Component: | Data Systems | Assignee: | Jiri Skrivanek <jskrivanek> |
Status: | RESOLVED WONTFIX | ||
Severity: | blocker | CC: | kfrank |
Priority: | P4 | Keywords: | I18N |
Version: | 6.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: | |
Attachments: | file that produces error dialog on nb6 |
Description
err
2007-08-09 04:24:38 UTC
Does (or should) the default handler check whether the data is binary or not? Perhaps the message should be: The file (extension <.xxx>) is not recognized by the ide and may not open properly. Do you wish to open the file in the text editor? The message box could have a couple of checkboxes like 'Do not ask this question for this type for this session' and/or 'Always open files of this type/extension in the text editor'. The default handler could maintain the lists of such types/extensions and not show the dialog further depending on user's choice. > Does (or should) the default handler check whether the data is binary or not?
DefaultDataObject does check the data; it examines the first 2K bytes doing:
if (arr[i] >= 0 && arr[i] <= 31 && arr[i] != '\n' && arr[i] != '\r' && arr[i] != '\t') { return null; }
This heuristic assumes a single byte gets turned into a char (AFAIK, I'm no encoding expert).
If it read the data from the file with an InputStreamReader, useing the correct encoding, into a char array then the
heuristic might produce much better results. Broadening the set of "binary" chars is also a consideration.
does this still happen with current nb6 ? there have been some additions to encoding handling and encoding properties since this issue was filed. ken.frank@sun.com Give me a sample file that is broken for you. Created attachment 56631 [details]
file that produces error dialog on nb6
I didn't try nb6.1. (I noticed the message of Dec13 from Ken Frank, I don't remember having seen it. I apologize for not responding) Reassigning all openide/data systems issues to the new owner jskrivanek. This bug was reported against NetBeans IDE 6.0 or an older release, or against a non-maintained module. NetBeans team does not have enough resources to get to this issue, therefore we are closing the issue as a WONTFIX. If you are interested in providing a patch for this bug, please see our NetFIX guidelines for how to proceed. We apologize for any inconvenience. Thank you. The NetBeans Team |