logo       

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

java.enhydra.general

Subject: 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
---------------------------------------------------



--
You receive this message as a subscriber of the enhydra@xxxxxxxxxxxxx mailing
list.
To unsubscribe: mailto:enhydra-unsubscribe@xxxxxxxxxxxxx
For general help: mailto:sympa@xxxxxxxxxxxxx?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise