mafintosh / tar-stream

tar-stream is a streaming tar parser and generator.
MIT License
406 stars 92 forks source link

Fails to extract an archive with GBK characters in file names ! #94

Closed alenhu closed 1 year ago

alenhu commented 5 years ago

I change headers.js 。 var iconvl = require('iconv-lite'); var UTF8 = require('utf-8'); var decodeStr = function (val, offset, length, encoding) { var tmp = val.slice(offset, indexOf(val, 0, offset, offset + length)); if(UTF8.isNotUTF8(tmp)){ return iconvl.decode(tmp,'GBK').toString(); }else{ return tmp.toString(); } }

mafintosh commented 1 year ago

if still revelant send a test case