portals-pluto-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Amit Jain <amitatgro...@gmail.com>
Subject Pluto doesn't support character encoding !!
Date Thu, 26 Dec 2013 06:55:49 GMT
Hi Pluto Team,

*Background: *

           We are developing an application using Pluto v1.0.7 with Struts
v2.0.9 MVC.

*Problem Description: *

Adding a business name with Greek characters ‘Αυτόείναιμιαδοκιμή’ is
rendered as ‘Αυτόείναιμιαδοκιμή’

*Root Cause:*

Our Portlet is executing in render phase and we found that it doesn’t
supports the character set encoding option. Other Portlet execution (like
‘event phase’ & ‘regular servlet result’) do support character set
encoding. Portlet those are executing in render phase uses ‘RenderResponse’
(RenderResponseImpl) object which implicitly uses
PrintWriterServletOutputStream object which don’t consider character set
encoding specified with the configuration.

*Solution: *

To get the expected result we have modified ‘
*org.apache.pluto.util.PrintWriterServletOutputStream*’ as below,

*public void write(byte[] pBuf, int pOffset, int pLength)*

*    throws IOException {*

*    String strValue = null;*

*    if(characterEncoding != null && !"".equals(characterEncoding)) {*

*       strValue = new String(pBuf, pOffset, pLength,
characterEncoding);           *

*    }*

*    if(strValue == null) {*

*        strValue = new String(pBuf, pOffset, pLength);*

*    }*

*    mPrintWriter.write(strValue);*


*PS: *
Below are the list of configuration which we used to specify the character
set encoding which don’t help us hence we modified the
PrintWriterServletOutputStream class to support specified character sets.
See the attachment for the same suggestion.

View raw message