ObjectWeb Consortium
Search ObjectWeb Mail Archive: 

Advanced Search - Powered by Google


Mail Archive Home | enhydra List | August 2005 Index

<--  Date Index     <--  Thread Index  -->

Re: [enhydra] Problem with UTF-8 and POST method in EE 6.3


Hi João,

thanks a lot for your help. It works now!
Here is a small update....

> 2) Where do you get this constant?
> HttpUtils.ENCODING
> I cannot find it...
>
> JPR - javax.servlet.http.HttpUtils

javax.servlet.http.HttpUtils is already deprecated.
Instead you can use:

comms.request.getHttpServletRequest()
    .getCharacterEncoding();

So this is the function (for others who might need
this...)

private String parseValuePart(MultipartMimeInputStream part)
                        throws IOException {
  charEncoding = comms.request.getHttpServletRequest()
    .getCharacterEncoding();
  byte[] buffer = new byte[2048];
  StringBuffer sb = new StringBuffer(2048);
  int n = 0;
  while ((n = part.read(buffer, 0, buffer.length)) != -1) {
    sb.append(new String(buffer, 0, n, charEncoding));
  }
  return sb.toString();
}

Cheers,
--
---------------------------------------------------
Blasius Lofi Dewanto
---------------------------------------------------
OpenUSS - Open University Support System
http://openuss.sourceforge.net
---------------------------------------------------
E-Mail   : dewanto@xxxxxxxxxxxxxxx
---------------------------------------------------




<--  Date Index     <--  Thread Index  -->

Reply via email to:

Powered by MHonArc.

Copyright © 1999-2005, ObjectWeb Consortium | contact | webmaster.