Hi Maarten.
I tried the updated version of and it's not working either.
I modified it to use NSISOLatin1StringEncoding and iso-8859-1 as
charset and everything is working right now.
I don't know if it's an error in the server but it would be
interesting to add the chance of specifying the encoding of the
requests in future versions.
Thank you.
> On 27 Sep 2009, at 11:20, Jorge <
jorfe...@gmail.com> wrote:
>
>
>
> > Thanks Maarten.
>
> > I'm having trouble applying the patch:
>
> > $ patch -p0 <~/Downloads/temp/encoding.patch
> > patch unexpectedly ends in middle of line
> > patch: **** Only garbage was found in the patch input.
>
> > On 27 sep, 10:38, Maarten Billemont <
lhun...@gmail.com> wrote:
> >> If the server behaves correctly; you won't need to modify it.
> >> Chances
> >> are it just interpretes ASIHttpRequest's bytestream as ISO-8859-1
> >> because it fails to specify the trueencodingof its data.
> >> Therefore,
> >> the patch could fix the issue for you.
>
> >> You apply a patch by running the ''patch -p0 < path-to-the-
> >> patchfile''
> >> command on terminal in the directory of the ASIHttpRequest classes.
> >> ''man patch'' explains how patching works. Alternatively, you can
> >> wait until this is fixed in ASIHttpRequest itself.
>
> >> On 27 Sep 2009, at 10:33, Jorge wrote:
>
> >>> Problem is I cant modify the webserver cause I'm not the
> >>> administrator. It's just a service I use from my App.
>
> >>> How do I apply that patch?
>
> >>> Thank you
>
> >>> On 27 sep, 10:20, Maarten Billemont <
lhun...@gmail.com> wrote:
> >>>> ASIHttpRequest does not currently support specifying custom
> >>>> encodings. I personally recommend configuring your server to
> >>>> respect
> >>>> Content-Type headers (which I'm not sure ASIHttpRequest's
> >>>> FormDataRequest sets, I modified it to do so). Your server should
> >>>> either way respect this header and convert whatever input data it
> >>>> gets
> >>>> from itsencodingto theencodingthat it operates in.
>
> >>>> See attached patch to add UTF-8encodingto the content-header of
> >>>> the
> >>>> request (UTF-8 because that's how ASIHttpRequest encodings your
> >>>> string
> >>>> data). Then it's up to the webserver to convert its bytestream to
> >>>> the
> >>>> correct characters based on the Content-Type header.
>
> >>>> encoding.patch
> >>>> < 1 KBVerDescargar
>
> >>>> On 27 Sep 2009, at 00:45, Jorge wrote:
>
> >>>>> I'm trying to post a form using ASIHTTPRequest this way:
>
> >>>>> ASIFormDataRequest *request = [[[ASIFormDataRequest alloc]
> >>>>> initWithURL:url] autorelease];
> >>>>> [request setPostValue:
self.name forKey:@"Name"];
>
> >>>>> Problem is the script on the server expects data formated in
> >>>>> ISOLatin1
> >>>>> and the request data is being sent UTF8 encoded. How can i change
> >>>>> the
> >>>>>encodingof the request data?
>
> >>>>> Thank you!!