Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 313273

Summary: [WPE] After entering 16bit unicode in the Source View of Web PageEditor, messy code may appear in the Design View.
Product: [WebTools] Java Server Faces Reporter: zhaojian <zhaoj>
Component: UIAssignee: Ian Trimble <ian.trimble>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3 CC: david_williams, raghunathan.srinivasan, ryohei.m
Version: unspecified   
Target Milestone: Future   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Create a Jsp file,open it using Web page Editor.
none
Messy code will be displayed in the design view.
none
Right code will be displayed in the preview.
none
Class file
none
Patch file none

Description zhaojian CLA 2010-05-17 22:12:33 EDT
Build Identifier: M20080911-1700

In the body element of JSP file, after entering 16bit unicode (For example "&#x2000B;"), the character it actually represents cannot be displayed properly in the Design View.


Reproducible: Always

Steps to Reproduce:
1. Create a JSP file, and open the file using Web PageEditor.
2. After entering �h&#x2000B;�h in the Source View, messy code may occur in the Design View. The character it actually represents cannot be displayed properly.
Comment 1 zhaojian CLA 2010-05-18 04:03:10 EDT
(In reply to comment #0)
> Build Identifier: M20080911-1700
> In the body element of JSP file, after entering 16bit unicode (For example
> "&#x2000B;"), the character it actually represents cannot be displayed properly
> in the Design View.
> Reproducible: Always
> Steps to Reproduce:
> 1. Create a JSP file, and open the file using Web PageEditor.
> 2. After entering �h&#x2000B;�h in the Source View, messy code may occur in the
> Design View. The character it actually represents cannot be displayed properly.

Supplement:
In the body element of JSP file, after manually entering 16bit unicode (For example "&#x2000B;"), the code will be displayed in the Design view, but its corresponding character cannot be displayed. After entering 16bit unicode through copy and paste, messy code will be displayed in the Design View.
Comment 2 David Williams CLA 2010-05-24 09:23:38 EDT
What is encoding of jsp page itself? Is it 16 bit code? 

<%@ tag language="java" pageEncoding="ISO-8859-1"%>
Comment 3 Nitin Dahyabhai CLA 2010-05-24 15:27:04 EDT
(In reply to comment #2)
I think you meant <%@ page language="java" pageEncoding="ISO-8859-1"%>, but is this a problem on the Source page as well?
Comment 4 David Williams CLA 2010-05-24 17:06:22 EDT
On second reading, I see this is (probably) just pasting a character Entity in the source page? Or ... is that just how is shows up in bugzilla? Also unclear as to which "Web Page Designer" editor is being used? The one that ships with WTP, all by itself? Or an adopter offering?
Comment 5 zhaojian CLA 2010-05-31 05:26:20 EDT
Created attachment 170497 [details]
Create a Jsp file,open it using Web page Editor.
Comment 6 zhaojian CLA 2010-05-31 05:28:11 EDT
Created attachment 170498 [details]
Messy code will be displayed in the design view.
Comment 7 zhaojian CLA 2010-05-31 05:29:06 EDT
Created attachment 170499 [details]
Right code will be displayed in the preview.
Comment 8 zhaojian CLA 2010-05-31 05:29:32 EDT
(In reply to comment #4)
> On second reading, I see this is (probably) just pasting a character Entity in
> the source page? Or ... is that just how is shows up in bugzilla? Also unclear
> as to which "Web Page Designer" editor is being used? The one that ships with
> WTP, all by itself? Or an adopter offering?

Please refer to the attached picture for details.
Comment 9 David Williams CLA 2010-05-31 13:41:02 EDT
thanks, those pictures really help. I'm moving this to WTP's JSF sub-project, as they are the ones providing that web page editor. 

Thanks for reporting.
Comment 10 Raghunathan Srinivasan CLA 2010-06-01 12:13:45 EDT
Thanks for reporting the issue. We will review in the next maintenance release.
Comment 11 zhaojian CLA 2010-06-27 23:35:12 EDT
(In reply to comment #10)
> Thanks for reporting the issue. We will review in the next maintenance release.

Idea of correction:
Every time when the user input characters in the Source View,TextEditPart converts the Unicode in the acquired text to corresponding characters, and then display the converted characters in CSSTextFigure.

Method of correction:
Plugin for correction: org.eclipse.jst.pagedesigner(v29980605)
File for correction: org.eclipse.jst.pagedesigner.parts.TextEditPart.java
Added file: org.eclipse.jst.pagedesigner.utils.UnicodeHelper

For details, please refer to the attached file.
Comment 12 zhaojian CLA 2010-06-27 23:36:43 EDT
Created attachment 172867 [details]
Class file
Comment 13 zhaojian CLA 2010-06-27 23:37:02 EDT
Created attachment 172868 [details]
Patch file
Comment 14 Raghunathan Srinivasan CLA 2011-01-12 15:16:26 EST
(In reply to comment #13)
> Created attachment 172868 [details]
> Patch file

Thanks for the contribution. We would like to commit the code. Please answer the following to help us with the IP log process:
1.  Confirm you wrote the code,
2.  Confirm you have the rights to donate the code to Eclipse,
3.  Confirm that you are submitting the code for inclusion in future Eclipse
releases under the Eclipse Public License.

Thanks
Raghu Srinivasan, Project Lead, JSF Tools Project
Comment 15 Raghunathan Srinivasan CLA 2011-01-19 19:48:33 EST
Deferring to 3.3 to get IP approval.
Comment 16 Raghunathan Srinivasan CLA 2011-03-15 16:24:09 EDT
Please respond to the questions in comment 14 to help us get the IP approval required to check in the patch.
Thanks
Comment 17 zhaojian CLA 2011-03-16 01:11:59 EDT
(In reply to comment #14)
> (In reply to comment #13)
> > Created attachment 172868 [details] [details]
> > Patch file
> 
> Thanks for the contribution. We would like to commit the code. Please answer
> the following to help us with the IP log process:
> 1.  Confirm you wrote the code,
> 2.  Confirm you have the rights to donate the code to Eclipse,
> 3.  Confirm that you are submitting the code for inclusion in future Eclipse
> releases under the Eclipse Public License.
> 
> Thanks
> Raghu Srinivasan, Project Lead, JSF Tools Project

1. This is the code I wrote.
2. I have the right to contribute this code to eclipse.
3. I'm sure this code can be included in the future release version of eclipse.

Thanks!
Comment 18 Raghunathan Srinivasan CLA 2011-05-26 14:17:13 EDT
Mass Triage: Deferred from Indigo
Comment 19 Raghunathan Srinivasan CLA 2011-05-26 14:19:22 EDT
Changing the Target Milestone to future