set it to utf8, not binary:
response.setEncoding('utf8');
-Mark
On Jan 2, 5:12 am, WebDeveloper <
emailforte...@gmail.com> wrote:
> thks man,
>
> I solve this,fork main.js into package
> request /usr/local/lib/node/.npm/request/0.10.0/package/lib/main.js
>
> options.request.addListener("response", function (response) {
> var buffer;
>
> //fix charset
> response.setEncoding('binary');
> //end fix
>
> if (options.responseBodyStream) {...
>
> sry my very bad english
>
> Saudações do Brasil!
>
> 2011/1/2 Mikeal Rogers <
mikeal.rog...@gmail.com>
>
>
>
>
>
>
>
> > request just appends each buffer it gets to a string which it sends to the
> > final callback. That means that the default .toString() is getting called.
>
> > I can add support for an encoding being sent to toString() if there is a
> > need for it. Alternatively you can pass a stream that the body will get
> > piped to so you'll have the raw buffer objects.
>
> > -Mikeal
>
> > ------------------------------
>
> > Rodrigo Gregorio <
emailforte...@gmail.com>
> > January 1, 2011 January 1, 20117:00 PM
>
> > Hi Ninjas,
>
> > How to solve the problem with ISO charset on response data in node.js?
>
> > sample code
>
> > request({uri:url}, function (error, response, body) {
> > if (!error && response.statusCode == 200) {
> > console.log(body);
> > }
> > });
>
> > get body data: a?ai
> > expected: açai
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "nodejs" group.
> > To post to this group, send email to
nod...@googlegroups.com.
> > To unsubscribe from this group, send email to
> >
nodejs+un...@googlegroups.com<
nodejs%2Bunsu...@googlegroups.com>
> > .
> compose-unknown-contact.jpg
> 1KViewDownload