dev@glassfish.java.net

Re: encoding in JSP Documents - JDK6 I18N Issue??

From: Jan Luehe <Jan.Luehe_at_Sun.COM>
Date: Mon, 06 Nov 2006 18:26:42 -0800

Krishna,

Krishnamohan Meduri wrote On 11/06/06 17:23,:

>Hi,
>
>Glassfish with JDK6 produces undesired results (with some characters
>messed up) for the attached JSP Document.
>The same produces the desired results with JDK5.
>
>Is this any known issue in JDK6? If so, Could somebody pls give me the
>details?
>
>

No details, but here's a related issue:

  http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6473140
  ("getCharacterEncoding() did not return the default-charset on
windows2003(JDK 6, AS90PE)")

that was filed against GlassFish.

I've done some initial investigation, and it looks like creating a
String, using the String constructor that takes a charsetName, throws
an UnsupportedEncodingException when specifying "Shift_JIS" as the
encoding on Windows (we use the String constructor that takes a
charsetName argument as a test to see if the encoding passed to
ServletRequest.setCharacterEncoding() is valid and supported by the
runtime). I've asked the submitter to confirm.

Do you see any UnsupportedEncodingException in your server log? Also,
do you see this problem on Windows only?


Jan


>Thanks,
>-Krishna.
>
>
>------------------------------------------------------------------------
>
><?xml version="1.0" encoding="big5"?>
><!--
> @author James Cai, for I18N feature in JSP 2.0 in XML
>
> Configuration as the following:
> Syntax pageEncoding contentType XML-prolog
> XML big5 gb2312 -
>-->
>
><jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
>version="2.0">
><jsp:directive.page contentType="text/html; charset=gb2312" />
><jsp:text><![CDATA[<HTML>
><HEAD>
> <TITLE>I18N TEST JSP2.0</TITLE>
></HEAD>
>
><BODY>
>
><FONT SIZE='+3'>
>
><CENTER>
>
><BR/>
>
>
><H1>Test Name: XML8-gb </H1>
>
><BR/>
><BR/>
><TABLE BORDER='1'>
><TR><TH>Language</TH><TH>Charset</TH></TR>
><TR><TD>Chinese</TD><TD>gb2312</TD></TR>
></TABLE>
>
><BR/>
>
>The following is Chinese character with gb2312 charset:
>
><BR/><BR/>
>
>京报网讯(记者 丁肇文)从今天开始,美国麻省理工学院斯隆管理学院与清华大学经管学院、复旦大学管理学院、香港岭南大学
> 为合作培养国际MBA,在香港召开顾问委员会会议。记者昨天从清华大学获悉,作为各自国家最顶尖的商学院之一的清华大学
> 经管学院与麻省理工学院斯隆管理学院,在圆满完成了第一个五年周期的合作之后,已经决定从今年起续签五年的合作项目,双方
> 从1500名申请者中选拔出的新一批120名合作培养的国际MBA学员,即将于今年9月进清华大学。
>
> 清华大学经管学院院长赵纯均昨天在接受记者采访时表示,清华自1996年与麻省理工合作以来,至今已培养了三期共100余名国
> 际MBA学员,这些毕业学员一般都去了国内外的跨国企业和组织,一直供不应求,有的在短短两三年内,就已经坐到了CEO
> 的位置;在合作期间,清华先后派出20余名教师,在斯隆经济管理学院学习。赵纯均院长还透露,在过去的合作中,清华方面的主
> 要精力集中在了必修课的建设方面,在第二个五年的合作中,放在选修课方面的精力会多一些。同时,这种类似于技术转让的模
> 式,在经历了五年的合作后已经实现了将国外成熟的MBA培养模式移植到国内的目标。
>
> 昨天专程到北京参加清华2001届国际MBA毕业典礼的斯隆管理学院前任院长、著名国际经济学家斯若教授也认为双方前五年
> 的合作非常成功,他曾经通过视频会议的方式“面对面”地为清华国际MBA学员授过课,他认为中国的国际MBA项目以及培
> 养出的学员都不比美国差,惟一的缺点在于学生的成分缺乏国际性,在美国大约40%的学员来自于其他不同的国家,而在中国几乎
> 是清一色的国内学员。
>
></CENTER>
><BR/>
><BR/>
>]]></jsp:text>
><jsp:text>CharacterEncoding:
></jsp:text>
><jsp:expression>response.getCharacterEncoding()</jsp:expression>
><jsp:text>&lt;BR/&gt;</jsp:text>
><jsp:text><![CDATA[
></body>
></html>
>]]></jsp:text>
></jsp:root>
>
>
>------------------------------------------------------------------------
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
>For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>
>