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 200398

Summary: [70cat] org.openide.text.DataEditorSupport$1: The file cannot be safely opened with encoding windows-1252. Do you want to continue opening it?
Product: platform Reporter: enydrueda
Component: Data SystemsAssignee: Vladimir Voskresensky <vv159170>
Status: RESOLVED WORKSFORME    
Severity: normal CC: adam_myatt, alaksundar, bokc, cristian_radulescu, damir.mitrovic, diesil, emiddio, fleka, gtzabari, lalbertme, leisenfelder, lolo_101, n0dwis, tomzi
Priority: P3    
Version: 7.0   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter: 180144
Attachments: stacktrace
stacktrace

Description enydrueda 2011-07-26 18:35:45 UTC
This bug was originally marked as duplicate of bug 198577, that is already resolved. This bug is still valid, so this seems to be another bug, but it might be related.

Build: NetBeans IDE 7.0 (Build nbms-and-javadoc-7588-on-20110726)
VM: Java HotSpot(TM) Client VM, 20.1-b02, Java(TM) SE Runtime Environment, 1.6.0_26-b03
OS: Windows 7

User Comments:
enydrueda: open python project, and another with git plugin

GUEST: index.php

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

gtzabari: Exception thrown when attempting to open file. File does not open.

GUEST: click with shift key over a function.

cristian_radulescu: CTRL+click to open class of instantiated object

GUEST: Navigate -> Find Declaration on a function in PHP file




Stacktrace: 
org.openide.text.DataEditorSupport$1: The file cannot be safely opened with encoding windows-1252. 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 enydrueda 2011-07-26 18:35:48 UTC
Created attachment 109625 [details]
stacktrace
Comment 2 adam_myatt 2011-09-24 00:52:24 UTC
Created attachment 111127 [details]
stacktrace

Running the EasyPMD tool using the Tasks window on a large project. Exception was thrown while waiting for Tasks window to refresh during EasyPMD scan.
Comment 3 Vladimir Voskresensky 2011-11-07 10:34:10 UTC
Can you attach problematic file? Most probably it is really can not be correctly displayed in win1252

+ sometimes such situation is normal, so code in 
gianlucacosta86.easypmd2.ide.IdeScanner.scan
should be rewritten as 
try {
 analyzer = new GuardedSectionsAnalyzer(.....);
} catch (UserQuestionException e) {
 e.confirm();
 analyzer = new GuardedSectionsAnalyzer(.....);
}

because it could be the issue not only with encoding, but with big files as well. (big files also through UserQuestionException)