|
From: Bill B. <bb...@re...> - 2012-12-17 16:16:15
|
If the content-type of the part doesn't have a charset, it will just be
converted to us-ascii...
But, InputPart has a setMediaType method that you can use before the
part is extracted.
inputPart.setMediaType("text/plain;charset=utf-8");
This fix was introduced 2.3.5
On 12/17/2012 7:57 AM, Raphael Silva wrote:
> Hi guys,
>
> I have a multipart upload service defined as this:
>
> @POST
> @Consumes(MediaTypeExt.MULTIPART_FORM_DATA)
> @Produces(MediaTypeExt.TEXT_PLAIN)
> public Response postProcesso(final MultipartInput uploadForm) throws
> Exception {
>
> And I'm getting the file name:
> part.getHeaders().getFirst("Content-Disposition") and the file content:
> part.getBody(byte[].class, null)
>
> The problem is that the file is UTF-8 encoded, but when I get the bytes
> from the part body it seems to be converted to another encoding, and I
> can't receive the file content properly.
>
> How can I receive a file from multipart post as UTF-8?
>
> Thanks in advance!
>
>
>
>
>
> ------------------------------------------------------------------------------
> LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
> Remotely access PCs and mobile devices and provide instant support
> Improve your efficiency, and focus on delivering more value-add services
> Discover what IT Professionals Know. Rescue delivers
> http://p.sf.net/sfu/logmein_12329d2d
>
>
>
> _______________________________________________
> Resteasy-developers mailing list
> Res...@li...
> https://lists.sourceforge.net/lists/listinfo/resteasy-developers
>
--
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com
|