Title: SV: JSP TagLibs and UTF8 Encoding
I already have the following entry in my /orion/config/global-web-application.xml file:

<orion-web-app jsp-cache-directory="./persistence" servlet-webdir="/servlet" development="true" default-charset="UTF-8">  

In fact, in the resulting XXX.jsp.java file created, due to having the development attribute set to true, 

this line of code appears:

response.setContentType("text/html;charset=UTF-8");

Therefore I believe the encodinding is getting set correctly. In fact the XML

files being imported by the JSP page have all been saved using UTF 8 encoding

as well. The issue is that when i attempt to get the bodyContent, inside the

custom JSP Tag, the UTF8 characters become munged.

 

What default encoding do you use for your webapp?
Could it be solved by just setting the default-charset to UTF-8 in your orion-web.xml ?



> I'm having an issue where a custom JSP BodyTag
> used in JSP Pages is producing some undesirable
> results. I am hoping someone out there has
> already encountered a similar problem and can
> point me in the right direction in solving mine.
>
> The issue is that my custom JSP BodyTag is a wrapper
> around JSP Code producing UTF8 Encoded XML Content.
> Portions of this content is encoded in UTF8 because
> they are language resources and this is the only
> way they can be represented (e.g. � and ? ). My JSP
> Body Tag Implementation takes the produced XML Content
> and processes it against an XSL Style Sheet to produce
> the desired display content. However, the UTF8 Characters
> are being munged and not displayed correctly.
>
> The crux of the matter is how do I maintain the encoding
> of the produced XML between the page being processed
> and handing it of to the XSL Parser for transformation.
> Currently I am trying to use something of the nature:
>
> StringReader xmlReader       = new
> StringReader(bodyContent.getString().trim());
> InputSource  xmlInputSource  = new InputSource(xmlReader);
>
> where the bodyContent is the standard internal JSP Tag extension
> member variable.
>
> I then used the created InputSource for any XML operations,
> but my content still has munged UTF8 characters.
>
> Anyone have any suggestions?
>
> Thanks Greatly,

---
Ted Rice
APAMA Ltd, 17 Millers Yard, Mill Lane
Cambridge CB2 1RQ, United Kingdom
Email:  [EMAIL PROTECTED]
Mobile: +44 (0)7899 876489
Phone:  +44 (0)1223 257973 [Histon Office]
Fax:    +44 (0)1223 518859  

Reply via email to