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

Bug 315799

Summary: TVT36:TCT352: PLK Corrupted NLV chars in JSP file template
Product: [WebTools] WTP Source Editing Reporter: CDE Administration <cdeadmin>
Component: jst.jspAssignee: jst.jsp <jst.jsp-inbox>
Status: RESOLVED WONTFIX QA Contact: Nitin Dahyabhai <thatnitind>
Severity: minor    
Priority: P3 CC: beldridg, camle, kitlo, nsand.dev, thatnitind, wujulia
Version: 3.2   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
17.000.310_corrupted_nlv_chars.JPG
none
17.000.310_corrupted_nlv_chars2.JPG
none
templates_pl.properties
none
Displayed inccorectly
none
scenario1_pageEncoding_ISO-8859-1
none
scenario2_jsp_files_preferences.png
none
scenario2_pageEncoding_UTF-8.png none

Description CDE Administration CLA 2010-06-04 12:07:10 EDT
<response_by> Moravia IT at 2010.05.28.10.09.57 </response_by>
Description:
NLS Build Label: 2010-05-26
Language: Polish
Must fix: No

Steps:
1.	Create a Dynamic Web Project (Ctrl+N > Web > Dynamic Web Project, click Next, give a Project name: (i.e. web_proj), then click Finish)
5.       Create a JSP with the following content
a) Right click the project(i.e. web_proj) and select New>JSP file
b) Give File name: (e.g try) and Select Finish, try.jsp editor will be opened at right side

Problem:
Content of generated file includes translation ("Enter title here"). NLV characters are not displayed correctly.

Kind Regards,
Maciek

<response_by> nguyer at 2010.05.28.15.11.18 </response_by>
Please try changing the setting described here: http://www-03.ibm.com/software/globalization/translationcommunications/BaseServlet.wss?taskName=ReadArticlePre&arrefnum=7700947218&prrefnum=2000002123 then try the test case again. This setting seems to fix almost all character corruption issues.

Thank you!

- Nicko Guyer

<response_by> nguyer at 2010.06.03.08.21.38 </response_by>
Maciek,

Did changing this setting resolve this issue for you?

Thank you,

- Nicko Guyer

<response_by> Moravia IT at 2010.06.03.09.16.53 </response_by>
Unfortunatelly it did not help. See attached screenshot.

Kind Regards,
Maciej

<response_by> nguyer at 2010.06.04.10.46.08 </response_by>
I am attaching the related Polish template file that this JSP file is generated from. I am also going to open a defect for this as it seems to affect all DBCS languages.

Thanks!

- Nicko Guyer

<response_by> nguyer at 2010.06.04.10.47.23 </response_by>
This article was reassigned from Category:''TVT/Testing,Inbox''.
Comment 1 CDE Administration CLA 2010-06-04 12:07:19 EDT
Created attachment 171117 [details]
17.000.310_corrupted_nlv_chars.JPG
Comment 2 CDE Administration CLA 2010-06-04 12:07:23 EDT
Created attachment 171118 [details]
17.000.310_corrupted_nlv_chars2.JPG
Comment 3 CDE Administration CLA 2010-06-04 12:07:25 EDT
Created attachment 171119 [details]
templates_pl.properties
Comment 4 CDE Administration CLA 2010-06-04 12:07:32 EDT
<cde:tctdetail>
Testcase: 17.000.310
Project: WSW36
Component: Xfer - WTP Java EE Tools/jst.j2ee
Priority: 3
Subject: PLK Corrupted NLV chars in JSP file template
Article ID: 352
Originator: tctbroadcast@pl.moraviaworldwide.com
</cde:tctdetail>
Comment 5 CDE Administration CLA 2010-06-07 13:36:54 EDT
<response_by> Kathy Li at 2010.06.07.12.15.07 </response_by>
We have documented this issue in bugzilla. Defer and evaluate fix in future release.
Comment 6 Nick Sandonato CLA 2012-10-17 16:25:24 EDT
Cannot reproduce the problem with the provided properties.
Comment 7 julia wu CLA 2013-09-05 03:10:12 EDT
Created attachment 235182 [details]
Displayed inccorectly

Switch locale to JP and using a new workspace to reproduced it, it can be reproduced.(attach 131_JP pic)
Comment 8 Nitin Dahyabhai CLA 2013-09-05 10:44:15 EDT
(In reply to julia wu from comment #7)
> Created attachment 235182 [details]
> Displayed inccorectly
> 
> Switch locale to JP and using a new workspace to reproduced it, it can be
> reproduced.(attach 131_JP pic)

Which fonts are set as the "Text Font" and "Structured Text Editor Text Fontæ" on the "Colors and Fonts" preference page?
Comment 9 Kit Lo CLA 2013-09-06 01:44:21 EDT
Created attachment 235216 [details]
scenario1_pageEncoding_ISO-8859-1
Comment 10 Kit Lo CLA 2013-09-06 01:45:22 EDT
Created attachment 235217 [details]
scenario2_jsp_files_preferences.png
Comment 11 Kit Lo CLA 2013-09-06 01:45:50 EDT
Created attachment 235218 [details]
scenario2_pageEncoding_UTF-8.png
Comment 12 Kit Lo CLA 2013-09-06 02:12:37 EDT
Nitin, the problem is not related to the font. I think there is an issue with the JSP files encoding initialization.

I have 2 scenarios to show the problem:

Scenarion 1:
- launch Eclipse in Japanese with -nl ja (assuming that you have the Japanese language packs installed)
- specify a new workspace
- create a new dynamic web project
- create a new JSP file
- you will see the question marks for the Japanese characters in "scenario1_pageEncoding_ISO-8859-1.png" attached above
- note that the pageEncoding in the JSP file is "ISO-8859-1"

Scenarion 2:
- launch Eclipse in Japanese with -nl ja (assuming that you have the Japanese language packs installed)
- specify a new workspace
- visit the JSF Files preferences page, make sure the encoding for .jsp files is "UTF-8", click OK button to close the preferences page; see "scenario2_jsp_files_preferences.png" attached above
- create a new dynamic web project
- create a new JSP file
- you will see the Japanese characters displayed properly in "scenario2_pageEncoding_UTF-8.png" attached above
- note that the pageEncoding in the JSP file is "UTF-8"

I think the default encoding for .jsp files should be set to "UTF-8" if the current locale is not English. Or, do you think it's still the user's job to go to the JSF Files preferences page to set it?
Comment 13 Toshihiro Izumi CLA 2013-09-06 22:24:25 EDT
"ここにタイトルを挿入" (\u3053\u3053\u306B\u30BF\u30A4\u30C8\u30EB\u3092\u633F\u5165) cannot be encoded into ISO-8859-1. So it is converted to "?", then you see "<title>??????????</title>".
The encoding process *itself* is working well.
The default ISO-8859-1 may be problematic for people in non-Latin-1 regions though.
Comment 14 Kit Lo CLA 2013-09-09 14:02:48 EDT
Nick, can you determine if this is an user error or a code problem?
Comment 15 Nick Sandonato CLA 2013-09-10 11:19:36 EDT
(In reply to Kit Lo from comment #14)
> Nick, can you determine if this is an user error or a code problem?

Hi Kit,

Thanks for following up with more information.

I think this is a case where the encoding should be set by the user beforehand. The specification states that ISO-8859-1 is the default character encoding in the absence of any specified. So we default to that in the preferences as well.