Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Scrap a site iso-8859-1 Ar�bia #5

Closed
phstc opened this Issue · 3 comments

2 participants

@phstc

Hello

I'm trying to scrap a site with iso-8859-1

    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

I'm getting � for the accents. How can I configure the encoding for iso-8859-1?

Cheers,
Pablo Cantero

@SaltwaterC
Owner

Hello,

For the moment, the encoding is not supported. The toString() method of the chunk buffer defaults the encoding to utf-8. You can save the raw response to a file, but I guess this is not what you want. http-get requires a patch to be able to pass a specific encoding if you're buffering the response body to a String object. I have plans to implement something in order to be able to return the buffer as Buffer object which would also fit the task.

Regards,
Stefan

@phstc

Hi @SaltwaterC

Tks for the reply.

Do you know other module that I can do it? I had this same problem with request module. :/

Regards,
Pablo Cantero

@SaltwaterC
Owner

Closed by relasing v0.4:

  • New option: bufferType for specifying the fact that the library should return the buffers as Buffer instance instead of String instance.
  • New option: encoding for specifying the encoding of the returned buffers, when returning the buffered data as string. Defaults to 'utf8'.

With this release people get generic buffer instances or strings in the designated encoding.

@SaltwaterC SaltwaterC closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.