You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Takashi Okamoto <to...@rd.nttdata.co.jp> on 2000/08/01 13:09:15 UTC
Character encoding patch for getParameter
Hello.
I made a patch for probrem with tomcat.
Now ,if we don't use 'en' locale ,we (don't use english people) must
decode character encoding.
For exapmle(encoding is EUC_JP,but other encoding is OK.):
----------------
response.setContentType("text/html;charset=EUC_JP");
String str = request.getParameter("PARAM_NAME");
String decode_str = null;
if(str!=null){
decode_str = new String(str.getBytes("8859_1") ,"EUC_JP");
str=decode_str;
}
----------------
But IBM 'WebSphere' (maybe 3.0) and Caucho 'Resin' don't have this problem.
They decode character encodings automatically.
and we write only:
----------------
response.setContentType("text/html;charset=EUC_JP");
String str = request.getParameter("PARAM_NAME");
----------------
So ,if we use this pache ,we are grad that we don't need decode
character encodings manually.
This patch is for Tomcat3.2 beta2.
Please do
% cd jakarta-tomcat/src/org/apache/core
% patch -p1 < RequestImpl.patch
and recompile tomcat.
Could you apply this patch on next tomcat release?
----------
NTTDATA Corporation, R&D Headquarters
Takashi Okamoto (mailto:tokamoto@rd.nttdata.co.jp)