bearcove/rc-zip

Removing Chardet dependency (or switch to chardetng) to not use LGPL3

Closed this issue · 1 comments

Hi,

I'm doing an "off the clock"/weekend project that I am hoping will become commercial (but it's far from it right now) and I want to use rc-zip because it works really really well for the zip files I'm using. However it's dependent on chardet which is LGPL (probably because chardet is LGPL) which means I can't use it in a commercial project (given how rust links the libraries).

Is there any way to make rc-zip not use chardet? For example using https://crates.io/crates/chardetng (not sure if it covers the right things)

To put my money where my mouth is I'm more than happy to donate 100USD for this effort via PayPal (or donate somewhere if you prefer). I know it's not much (especially to change a dependency, create a new version and upload to crates.io) but given that my project is miles away from generating any revenue at all it's all I can afford right now really :) I guess it's more a token of appreciation.

I know the right way is to submit a PR but frankly my rust skills are probably too limited to do this right.

Regards,
Niklas

I just looked into chardetng but it looks like it detects some Codepage 437 text as being Shift-JIS (to be fair, it doesn't look for CP437 at all):

running 1 test
test.zip: should be utf-8

                                             👇
ng detected Encoding { Shift_JIS } (confident? true), old detected ISO-8859-1 with confidence 0.73
cp-437.zip: should be cp-437

ng detected Encoding { Shift_JIS } (confident? true), old detected SHIFT_JIS with confidence 1
shift-jis.zip: should be shift-jis

test tests::real_world_files ... ok

So it seems like a no-go for now, sorry :(