Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 333132 - [translation] Double Byte characters are not persisted correctly during JSP Translation
Summary: [translation] Double Byte characters are not persisted correctly during JSP T...
Status: RESOLVED FIXED
Alias: None
Product: WTP Source Editing
Classification: WebTools
Component: jst.jsp (show other bugs)
Version: 3.2.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.2.3   Edit
Assignee: Sarika Sinha CLA
QA Contact: Nick Sandonato CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-23 02:17 EST by Sarika Sinha CLA
Modified: 2011-01-05 17:12 EST (History)
1 user (show)

See Also:
nsand.dev: review+


Attachments
Patch to use writChars to store the translated JSP file (1.22 KB, patch)
2010-12-23 02:20 EST, Sarika Sinha CLA
no flags Details | Diff
Patch to use writChars to store the translated JSP file with SerialVersionUI change (1.61 KB, patch)
2010-12-24 00:22 EST, Sarika Sinha CLA
nsand.dev: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.