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 206876

Summary: [71cat] org.openide.text.DataEditorSupport$1: The file cannot be safely opened with encoding UTF-8. Do you want to continue opening it?
Product: python Reporter: paolosca <paolosca>
Component: EditorAssignee: Lou Dasaro <mr_lou_d>
Status: RESOLVED DUPLICATE    
Severity: normal CC: abien, alaksundar, Alniks, averri, Billo, bokc, carljmosca, cristian_radulescu, dagguh, damir.mitrovic, david.zapata, diesil, djpable, emiddio, enydrueda, fabriziogiudici, fleka, FrantaM, gtzabari, Herr_Nilsson, ionuion, jarome, javydreamercsw, jbsabmello, jocke, jomello_br, jyeary, kalwi, karianna, KhArtNJava, kosmonaffft, lalbertme, leisenfelder, lolo_101, marcomsousa, medeag, misterm, muhammadghazali, n0dwis, nashuald, oj-nb, onmomo, pekarna, pietrangelo, rdion, reinouts, rjdkolb, rodrigorsantos, rudyment, sebglon, shmaltorhbooks, stefanocrosta, t3_chris, timhaak, trozzonick, twolf2919, vinaykrsharma1986, walid25
Priority: P2    
Version: 7.2   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter: 184127
Attachments: stacktrace
stacktrace
stacktrace
stacktrace
stacktrace
stacktrace
stacktrace
stacktrace
stacktrace

Description paolosca 2012-01-03 15:28:04 UTC
This bug was originally marked as duplicate of bug 205761, that is already resolved. This bug is still valid, so this seems to be another bug, but it might be related.

Build: NetBeans IDE Dev (Build 201201020601)
VM: OpenJDK Client VM, 21.0-b17, OpenJDK Runtime Environment, 1.7.0_147-icedtea-b147
OS: Linux

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

GUEST: Opening the file

enydrueda: open python project, and another with git plugin

GUEST: ?????????????

GUEST: click with shift key over a function.

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

Lolo_101: A warning is ok, but i'd like to be able to open the file anyway !

cristian_radulescu: CTRL+click to open class of instantiated object

GUEST: index.php

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

paolosca: Opened refactoring rename

GUEST: clicked Compilation error line link in the output window.

GUEST: step into a method

lalbertme: Refectoring in linux




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:506)
   at org.openide.text.DataEditorSupport.loadFromStreamToKit(DataEditorSupport.java:496)
   at org.openide.text.CloneableEditorSupport.loadDocument(CloneableEditorSupport.java:2121)
   at org.openide.text.CloneableEditorSupport.access$2800(CloneableEditorSupport.java:129)
   at org.openide.text.CloneableEditorSupport$Listener.run(CloneableEditorSupport.java:2927)
   at org.openide.text.CloneableEditorSupport$3.doRun(CloneableEditorSupport.java:722)
Comment 1 paolosca 2012-01-03 15:28:08 UTC
Created attachment 114587 [details]
stacktrace
Comment 2 javydreamercsw 2012-02-20 00:09:58 UTC
Created attachment 115930 [details]
stacktrace

Opening files
Comment 3 enomigolzar 2012-02-22 09:05:18 UTC
i generate a new project java ee with Imports an existing Enterprise application client into a standard IDE project. My problem is a compile error " unmappable character for encoding UTF-8":
If i try to open the file i get:
The file cannot be safely opened with encoding UTF-8. Do you want to continue opening it?
Comment 4 Jaroslav Tulach 2012-03-01 16:19:59 UTC
DataSupportEditor throws regular UserQuestionException, which is an IOException. The proper behavior of the code should be to cache UserQuestionException, ask the user and re-run the action. This is documented at
http://bits.netbeans.org/dev/javadoc/org-openide-util/org/openide/util/UserQuestionException.html

The callers that need to deal with UserQuestionException include:

gianlucacosta86.easypmd2.ide.editor.GuardedSectionsAnalyzer.<init>

org.netbeans.modules.gsf.spi.GsfUtilities.getDocument(GsfUtilities.java:206)
http://statistics.netbeans.org/exceptions/messageslog?id=562420

Most of the recent problems seem to be caused by Gian Luca, but rather moving to Gsf as that is our code and we can fix it.
Comment 5 Jaroslav Tulach 2012-03-01 17:38:30 UTC
*** Bug 208966 has been marked as a duplicate of this bug. ***
Comment 6 Milutin Kristofic 2012-03-13 14:05:07 UTC
It's fixed in csl in org.netbeans.modules.csl.spi.GsfUtilities. This is a bug in gsf which is in contrib, therefore I reassign it to python.
Comment 7 javydreamercsw 2012-05-21 22:15:09 UTC
Created attachment 119709 [details]
stacktrace

Formatting a project (right click on project)
Comment 8 javydreamercsw 2012-06-12 14:52:47 UTC
Created attachment 120738 [details]
stacktrace

Clciked on link in output window after a Maven compilation error (Unmappable character for encoding UTF-8)

I believe is a ?
Comment 9 misterm 2012-06-27 21:38:07 UTC
Created attachment 121470 [details]
stacktrace
Comment 10 misterm 2012-06-27 21:41:07 UTC
Created attachment 121471 [details]
stacktrace
Comment 11 misterm 2012-06-28 18:41:03 UTC
Created attachment 121511 [details]
stacktrace
Comment 12 kosmonaffft 2012-10-01 14:46:22 UTC
I've seen similar exception in CND module when try to reformat sources in all project... See bug http://netbeans.org/bugzilla/show_bug.cgi?id=219275
Comment 13 kosmonaffft 2012-10-15 13:59:15 UTC
Created attachment 125971 [details]
stacktrace
Comment 14 medeag 2013-05-16 07:07:58 UTC
Created attachment 134493 [details]
stacktrace

click on the warning while buildling maven app
Comment 15 Lou Dasaro 2015-04-20 17:52:34 UTC
Because this is now assigned to Python, I am resolving it as a DUPLICATE of the Umbrella Bug 153498 - "Provide support for UTF-8", which is now being addressed.

If this problem affects you, please follow it there.
If this is a non-Python problem, please search for "UTF" and the product affected or file a new bug. Thank you.

*** This bug has been marked as a duplicate of bug 153498 ***