This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 66323 - I18N - JSP compile warnings with using non-ascii characters like Japanese
Summary: I18N - JSP compile warnings with using non-ascii characters like Japanese
Status: VERIFIED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: JSP (show other bugs)
Version: 5.x
Hardware: All All
: P3 blocker with 2 votes (vote)
Assignee: Tomas Mysik
URL:
Keywords: I18N
Depends on:
Blocks:
 
Reported: 2005-10-09 09:14 UTC by naoki
Modified: 2008-07-10 18:11 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
JSP page which includes Japanese charcters (windows-31j encoding (578 bytes, application/octet-stream)
2006-08-03 07:03 UTC, Keiichi Oono
Details

Note You need to log in before you can comment on or make changes to this bug.
Description naoki 2005-10-09 09:14:44 UTC
When JSP file includes Japanese character on encoding Windows-31J, JSP 
compilation is failed.
But Tomcat can execute it.
For example this JSP. "wa" is written instead of Japanese character HIRAGANA.
---
<%@page contentType="text/html; charset=Windows-31J"%>
wa
---
Comment 1 naoki 2005-10-09 21:16:41 UTC
Please move i18n category.
Comment 2 naoki 2005-10-09 21:20:12 UTC
move to code subcomponent.
Comment 3 Marian Petras 2005-10-21 17:45:37 UTC
Moved to component "web". I do not which subcomponent is the most suitable, I
set "jspcompiler" as the first try.

Component "i18n" is reserved for issues related to the Internationalization module.
Comment 4 Petr Pisl 2005-12-05 17:35:55 UTC
I'm not able to reproduce on my system. Is it enough to change the encoding  to
Windows-31J?

Could you provide informations: build number of IDE, JDK, OS version?
Comment 5 naoki 2005-12-06 03:06:18 UTC
My environment I had tried is
JDK: 1.5.0_04
NetBeans: 5.0 Beta2(Build 200511141730)
OS: Windows XP

If I had added "-encoding utf-8" to Compiler Options, It would go well. But Java 
 classes wouldn't be able to be compiled.

The real script that uses HIRAGANA is shown below.
---
<%@page contentType="text/html; charset=Windows-31J"%>
わ
---
Comment 6 Jaroslav Pospisil 2006-03-13 13:43:42 UTC
TM 5.0->TBD
Comment 7 Keiichi Oono 2006-08-03 07:03:00 UTC
Created attachment 32484 [details]
JSP page which includes Japanese charcters (windows-31j encoding
Comment 8 Keiichi Oono 2006-08-03 07:17:47 UTC
I've attached windows31j.jsp to reproduce this problem. This problem is caused
only when JSP compilation in the IDE. When JSP is compiled and executed in
Tomcat, it works fine.

To reproduce:
  - Run IDE in the euc-jp (Solaris default) or UTF-8 (Linux default) environment
  - copy attached widnows31j.jsp into the Web application project
  - right-click windows31j.jsp and execute JSP compilation

When JSP is converted to Servlet, the encoding is kept (converted Servlet is
windows-31j encoded .java program. However, IDE try to compile converted Servlet
as system default encoded .java file. So then, javac compiler is saying there
are illegal characters.

Because the attached JSP file can work on Tomcat in the same environment. I
think Tomcat Servlet compilation works well for Servlet source file which
encoding is different from compiling machine.

Can it be fixed to detect converted Servlet encoding for compilation?

Please let me know if you have any questions or suggestions.
Comment 9 Petr Pisl 2006-08-28 16:02:36 UTC
I tried it with NetBeans 5.5, where some changes were done in this area and it
works for me. Could you confirm/disconfirm this?
Comment 10 Keiichi Oono 2006-08-29 12:19:53 UTC
Thank you. I've tried the latest daily build (Build 200608280000), but the
problem is still caused. The warnings are listed in the output window. Would you
try it again? My environment is:

Solaris 10 x86
locale: ja



Comment 11 Petr Pisl 2007-10-18 13:22:33 UTC
Still reproducible. 
Comment 12 kaa 2007-10-18 16:23:43 UTC
I've tried on XP.ja_JP and project encoding win31j, build 1010:
Created WebApp and used the file from above. App compilation works ok without warnings.
Comment 13 Keiichi Oono 2007-10-19 11:20:26 UTC
No, you need to prepare JSP file with different encoding from system default. I've attached windows-31j encoded file to
reproduce in Solaris euc-jp environment.

However, I think this can be closed now because of the following result:

Windows XP (Japanese)
build: 200710150000
 - Project encoding UTF-8 (default)
     case:1  compile JSP file encoded by UTF-8       PASS
     case:2  compile JSP file encoded by windows-31j PASS
     case:3  compile JSP file encoded by euc-jp      PASS

Solaris
build:200710180000
 - Project encoding UTF-8 (default)
     case:1  compile JSP file encoded by UTF-8       PASS
     case:2  compile JSP file encoded by windows-31j PASS
     case:3  compile JSP file encoded by euc-jp      PASS


* PASS means, compiling finished successfully without any errors and warnings.

Should I update this report as RESOLVED/FIXED?

Thank you.
Keiichi
     
Comment 14 Petr Pisl 2007-10-22 08:30:19 UTC
Did you try also set up a project encoding and set the page encoding with an incompatible encoding to project encoding?
Comment 15 Keiichi Oono 2007-10-22 11:05:37 UTC
Thank you for your pointing this out. The result is different from default project encoding (UTF-8):

Windows XP (Japanese)
build: 200710150000
 - Project encoding windows-31j (same as system encoding)
     case:1  compile JSP file encoded by UTF-8       FAIL
     case:2  compile JSP file encoded by windows-31j FAIL
     case:3  compile JSP file encoded by euc-jp      FAIL

The warning message is displayed "Cannot map this character to windows-31j".


Solaris
build:200710180000
 - Project encoding EUC-JP (same as system encoding)
     case:1  compile JSP file encoded by UTF-8       FAIL
     case:2  compile JSP file encoded by windows-31j FAIL
     case:3  compile JSP file encoded by euc-jp      FAIL

The warning message is displayed "This character can not map to EUC-JP".


I've checked the generated java source files at:
    <project_directory>/build/generated/src/org/apache/jsp
The java file is always generated by UTF-8 encoding:
  Project encoding = UTF-8       --->  All Java files are generated by UTF-8
  Project encoding = windows-31j --->  All Java files are generated by UTF-8
  Project encoding = EUC-JP      --->  All Java files are generated by UTF-8 


This issue can not be closed yet.
Please let me know if there are any thing I should check my environment.
Comment 16 Jiri Prox 2008-04-11 01:20:15 UTC
moving opened issues from TM <= 6.1 to TM=Dev
Comment 17 Tomas Mysik 2008-06-19 12:21:53 UTC
I tried to reproduce and it seems that it is OK now. Could anyone verify please? Thanks.

Product Version: NetBeans IDE Dev (Build 080619)
Java: 1.6.0_06; Java HotSpot(TM) Client VM 10.0-b22
System: Linux version 2.6.25-gentoo-r5 running on i386; UTF-8; cs_CZ (nb)
Comment 18 kaa 2008-07-10 18:11:15 UTC
Product Version: NetBeans IDE Dev (Build 200807060002)
Java: 1.6.0_06; Java HotSpot(TM) Client VM 10.0-b22
System: Windows XP version 5.1 running on x86; MS932; ja_JP (nb)

I checked the file with UTF-8/win-31j project encodings - compilation PASSED in both cases.