Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

getting incomplete charset #8

Open
Janpot opened this issue May 19, 2016 · 2 comments
Open

getting incomplete charset #8

Janpot opened this issue May 19, 2016 · 2 comments
Labels

Comments

@Janpot
Copy link

Janpot commented May 19, 2016

var charset = require('charset');
charset({}, '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<!--\n\t\tStefna ehf. - Moya Vefumsjónarkerfi\n\t\t- - - - - - - - - - - - - - - - - -\n\t\thttp://www.moya.is - stefna@stefna.is\n\n\t\tMoya - Útgáfa 1.16\n\t\t- - - - - - - - - - - - - - - - - -\n-->\n<html \n\txmlns:og=\"http://opengraphprotocol.org/schema/\"\n\txmlns:fb=\"http://www.facebook.com/2008/fbml\"\n\txmlns=\"http://www.w3.org/1999/xhtml\"\n\txml:lang=\"is\"\n\tlang=\"is\">\n<head>\n        <meta charset=\"iso-8859-1\" />')

Running this code returns 'iso-8859' instead of 'iso-8859-1'

@fengmk2
Copy link
Member

fengmk2 commented May 19, 2016

@Janpot Can you send a pr to fix this?

@fengmk2 fengmk2 added the bug label May 19, 2016
@Janpot
Copy link
Author

Janpot commented May 19, 2016

@fengmk2 Been looking into this. Turns out the charset string was right on the middle of the default peekSize. Undocumented parameter to the function. Any preference on how to handle a situation like this? Personally I think in this edge case it should either return null or the full encoding. Not a half encoding like this in case.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants