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 198577 - org.openide.text.DataEditorSupport$1: The file cannot be safely opened with encoding UTF-8. Do you want to continue opening it?
Summary: org.openide.text.DataEditorSupport$1: The file cannot be safely opened with e...
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Data Systems (show other bugs)
Version: 7.0
Hardware: All All
: P3 normal (vote)
Assignee: Vladimir Voskresensky
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-13 08:34 UTC by emiddio
Modified: 2011-05-31 21:09 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 178110


Attachments
stacktrace (1.21 KB, text/plain)
2011-05-13 08:34 UTC, emiddio
Details
File triggering a warning dialog (not exception) (84.56 KB, application/octet-stream)
2011-05-31 11:11 UTC, _ gtzabari
Details

Note You need to log in before you can comment on or make changes to this bug.
Description emiddio 2011-05-13 08:34:29 UTC
Build: NetBeans IDE Dev (Build 201105120000)
VM: Java HotSpot(TM) 64-Bit Server VM, 19.0-b09, Java(TM) SE Runtime Environment, 1.6.0_23-b05
OS: Windows 7

User Comments:
GUEST: index.php

line
-----------------------
require_once("config.php");
---------------------------
ctrl+click on "config.php"




Stacktrace: 
org.openide.text.DataEditorSupport$1: The file cannot be safely opened with encoding UTF-8. Do you want to continue opening it?
   at org.openide.text.DataEditorSupport.createAndThrowIncorrectCharsetUQE(DataEditorSupport.java:455)
   at org.openide.text.DataEditorSupport.loadFromStreamToKit(DataEditorSupport.java:446)
   at org.openide.text.CloneableEditorSupport.loadDocument(CloneableEditorSupport.java:2156)
   at org.openide.text.CloneableEditorSupport.access$2800(CloneableEditorSupport.java:133)
   at org.openide.text.CloneableEditorSupport$Listener.run(CloneableEditorSupport.java:2986)
   at org.openide.text.CloneableEditorSupport$3.doRun(CloneableEditorSupport.java:710)
Comment 1 emiddio 2011-05-13 08:34:33 UTC
Created attachment 108267 [details]
stacktrace
Comment 2 Vladimir Voskresensky 2011-05-31 07:29:02 UTC
can you attach file which is opened with exception?
Comment 3 _ gtzabari 2011-05-31 11:10:45 UTC
build 201105190400 seems to pop up a warning dialog instead of throwing an exception. I'll attach the file triggering the warning dialog, just in case.
Comment 4 _ gtzabari 2011-05-31 11:11:15 UTC
Created attachment 108618 [details]
File triggering a warning dialog (not exception)
Comment 5 Vladimir Voskresensky 2011-05-31 20:41:50 UTC
(In reply to comment #4)
> Created an attachment (id=108618) [details]
> File triggering a warning dialog (not exception)
Thanks for the sample file.
Btw, this file is not in UTF-8 encoding, so IDE is not doing mistake by showing dialog, right?
More other encoding can not be 100% reliably detected for this file i.e. by gedit as well.
What have you expected instead?

Thanks,
Vladimir.
Comment 6 _ gtzabari 2011-05-31 21:07:14 UTC
Vladimir,

The problem was that Netbeans was throwing an exception as opposed to showing a dialog. As I mentioned, I cannot reproduce the problem in dev build 201105190400 but I remember seeing it in the past. It's possible this issue is fixed.
Comment 7 Vladimir Voskresensky 2011-05-31 21:09:55 UTC
(In reply to comment #6)
> It's possible this issue is
> fixed.
Ok. I see.

Does Anyone else have still reproducible exception-based scenario? If yes, please, reopen with file and testcase.