hjyssg / ShiguReader

硬核宅宅资源管理器. Ultimate Manga Resource Manager
MIT License
400 stars 45 forks source link

[Todo] windows console不设置成unicode,listZipContent()会乱码 #48

Open hjyssg opened 4 years ago

hjyssg commented 4 years ago

看看可不可以decoding

hjyssg commented 4 years ago

//Specify the character encoding used to decode the stdout and stderr output. If set to null, then stdout and stderr will be a Buffer instead of a string.
 let {stdout, stderr} = await limit(() => execa(sevenZip, ['l', '-r', '-ba' ,'-slt', filePath], {encoding: null})      );
//stdout is buffer
stdout.toString("utf8")

这个不work 出来的buffer把日语假名全部变成___了

hjyssg commented 4 years ago

if(files.length === 0){
               res.sendStatus(404);
               console.error(`[/api/extract] ${filePath} has no content`);
              return
 }
hjyssg commented 4 years ago

https://stackoverflow.com/questions/46603489/how-to-force-utf-8-in-node-js-with-exec-process

hjyssg commented 3 years ago

https://github.com/hjyssg/ShiguReader/pull/189/commits/8a64352974d8d5314282e20ea0c959acbd756b7e