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

Bug 333132

Summary: [translation] Double Byte characters are not persisted correctly during JSP Translation
Product: [WebTools] WTP Source Editing Reporter: Sarika Sinha <sarika.sinha>
Component: jst.jspAssignee: Sarika Sinha <sarika.sinha>
Status: RESOLVED FIXED QA Contact: Nick Sandonato <nsand.dev>
Severity: normal    
Priority: P3 CC: thatnitind
Version: 3.2.2Flags: nsand.dev: review+
Target Milestone: 3.2.3   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Patch to use writChars to store the translated JSP file
none
Patch to use writChars to store the translated JSP file with SerialVersionUI change nsand.dev: iplog+

Description Sarika Sinha CLA 2010-12-23 02:17:12 EST
Build Identifier: Version: 3.2.0.v201005290030

out.println("<INPUT type=\"submit\" name=\"hello\" value=\"&#26908;&#32034;&#38283;&#22987;\">");

Double Byte character in value is not persisted correctly. If add a double quote before the doublr byte character , we get an error for "Syntax error, delete these tokens". after removing the extra double quote the error goes off. But if we we reopen the file after save and close, the error comes back.

Reproducible: Always
Comment 1 Sarika Sinha CLA 2010-12-23 02:20:17 EST
Created attachment 185749 [details]
Patch to use writChars to store the translated JSP file

Writing in Bytes was not storing the double byte characters, and hence using writeChars(s) to persist the string.
Comment 2 Nick Sandonato CLA 2010-12-23 14:39:46 EST
Hi Sarika,

I think we might have a problem for old translations that are written as single-byte, since readString() reads it as double-byte now. As noted, serialVersionUID needs to be updated since readString() and writeString() were modified.

Please make this change, and the patch should be good after that.
Comment 3 Sarika Sinha CLA 2010-12-24 00:22:00 EST
Created attachment 185801 [details]
Patch to use writChars to store the translated JSP file with SerialVersionUI change

Hi Nick,
Thanks for pointing it out. I have incremented the serialVersionUID.
Comment 4 Nick Sandonato CLA 2011-01-05 16:54:05 EST
Changes checked in.