Bug 145754

Summary: [encoding] Need encoding error detection for text load
Product: [Eclipse Project] Platform Reporter: Susumu Fukuda <fukudas>
Component: TextAssignee: Platform-Text-Inbox <platform-text-inbox>
Status: ASSIGNED --- QA Contact:
Severity: normal    
Priority: P3 CC: aleherb+eclipse, Olivier_Thomann, schierlm, sjoerd-eclipse, wswb0922
Version: 3.2Keywords: helpwanted
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Susumu Fukuda CLA 2006-06-07 08:48:01 EDT
Need encoding error detection for text loading

ResourceTextBuffer reads content regardless of encoding conversion
error. It make the buffer un-saveable with invalid characters. But
user cannot know the situation. It results, on the Text Editor, that
modifications made to the buffer cannot be saved.

Steps to Reproduce:
1. Import a little bit broken sample.jsp containing a following content
   to workspace
----------------
"<%@page pageEncoding=\"US-ASCII\"%>\n" +
"\u00a9 My Company\n" // \u00a9 is a (C) mark, a charactor of ISO-8859-1
----------------
   # with WTP, the detected encoding is US-ASCII.
   # it's the same if you use file's properties dialog to set encoding
2. Open the file with Text Editor
 >> Text Editor opens.
 >> '(C)' is not present. No warning, no error.
3. Type text in 3rd line, and try to save it
 >> Error dalog saying 'Some characters cannot be mapped...' opens.
 >> And it never gets fixed because '(C)' is not present in the document.

Expected Result:
  At step 2, similar to Bug #107007, some status should be set to the buffer,
  I think. And the editor should show the error.

Build I20060602-1317 (3.2 RC7)
Comment 1 Dani Megert CLA 2006-06-07 09:11:04 EDT
Test Case:
1. open a file using ISO-8859-1
2. add Alt+0169
3. save and close
4. change encoding to US-ASCII
5. open the file
6. type "foo"
7. save
==> dialog comes up

We have to throw an exception and fail to open it. The user will then have to change the encoding in order to open that file in the editor.
Comment 2 Dani Megert CLA 2006-10-26 02:30:27 EDT
*** Bug 159516 has been marked as a duplicate of this bug. ***
Comment 3 Dani Megert CLA 2006-10-26 02:35:54 EDT
The exception should trigger the status editor with inlined control to change the encoding (same scenario as if there was an UnsupportedEncodingException).

An deluxe solution would add an additional button to the status editor:
  [Open file and convert illegal characters]

NOTE: we must check that using different read mechanisms doesn't affect performance.

We won't have time to do this unless we get a high quality patch.
Comment 4 Dani Megert CLA 2006-10-26 09:03:41 EDT
*** Bug 159516 has been marked as a duplicate of this bug. ***
Comment 5 Dani Megert CLA 2009-06-15 07:53:39 EDT
*** Bug 280233 has been marked as a duplicate of this bug. ***
Comment 6 Michael Schierl CLA 2009-08-10 13:45:08 EDT
*** Bug 285922 has been marked as a duplicate of this bug. ***
Comment 7 Dani Megert CLA 2009-10-19 12:14:02 EDT
*** Bug 57556 has been marked as a duplicate of this bug. ***
Comment 8 Eclipse Webmaster CLA 2019-09-06 15:32:16 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.
Comment 9 Eclipse Webmaster CLA 2019-09-06 15:36:19 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.