cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sergey Beryozkin <sberyoz...@gmail.com>
Subject Re: UTF-8 Characters in Request Params for REST Service
Date Wed, 23 Jun 2010 18:00:43 GMT
I need to know the details of the request and how a resource method
expecting the values looks like

thanks, Sergey

On Tue, Jun 22, 2010 at 7:10 PM, Rakesh Rai <rairakesh@gmail.com> wrote:

> This is the method that does the trick.... converts to UTF-8 and transforms
> to UTF-8 format string and sends it back to the caller
> Wherever in your service class / action class add this method and convert
> the existing string to return the UTF-8 transformed string / text
>    /**
>     *
>     * @param utfEightString
>     * @return String converted to USF-8 format and send it to the caller .
>     * @throws java.io.
> UnsupportedEncodingException
>     */
>    public static final String utfEightConvert(String utfEightString)
>            throws java.io.UnsupportedEncodingException {
>
>        byte[] bytes = new byte[utfEightString.length()];
>        for (int i = 0; i < utfEightString.length(); i++) {
>            bytes[i] = (byte) utfEightString.charAt(i);
>        }
>        return new String(bytes, "UTF-8");
>
>    }
>
> Hope it helps.
> Rakesh
>
>
> On Tue, Jun 22, 2010 at 1:47 PM, Sergey Beryozkin <sberyozkin@gmail.com
> >wrote:
>
> > Is it a form based submission ? or XML is posted in the body ?
> >
> >
> > cheers, Sergey
> >
> > On Mon, Jun 21, 2010 at 6:00 PM, Loh Kok Jeng <kokjeng.loh@gmail.com>
> > wrote:
> >
> > > Dear all,
> > >
> > > I'm struggling with non-ASCII characters passed in request params of a
> > > REST service.  The characters become ? when received by my app
> > > developed using CXF.  The encoding is set to UTF-8 by the REST client.
> > >  Why do I get "?"?
> > >
> > > Thanks in advance.
> > >
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message