Replace node-compress with built-in zlib module #4

merged 2 commits into from Aug 13, 2012


None yet
2 participants

sphericalhorse commented Jul 25, 2012

In node v0.6 was added zlib module to works with data compression, so node-compress is now unneeded.

@sphericalhorse sphericalhorse commented on the diff Jul 25, 2012

var buf = [], len = 0;
- stream.setEncoding(mime.charsets.lookup(mimeType))

sphericalhorse Jul 25, 2012


I've replaced this sting with this, because objects, which returns by zlib.createUnzip don't have setEncoding method by some reasones.

Also note, that function mime.charsets.lookup passes two arguments, where second is a default charset.
This function returns default charset for all mimes, which don't passes ^text/ regexp, for all other mimes it returns UTF-8.
And if you used setEncoding to change encoding of incoming data from something like windows-1250, or koi8-u, then you should know, that this function and toString can't handle that kind of encodings. Also, here you deletes information about encodings.

slaskis merged commit 02ffb19 into publicclass:master Aug 13, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment