Skip to content

Commit 27c863b

Browse files
authored
Fix: Error extracting files with 7zip if the file name contained UTF8 characters
1 parent e12383a commit 27c863b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
2121
- Don't show drag menu if the event comes from the app [`383f9fe`](https://github.com/ollm/OpenComic/commit/383f9fe30d535260e6f6091242289d99ac4d755b)
2222
- PDF zoom not work if device pixel ratio is upper 1 [`d318cfc`](https://github.com/ollm/OpenComic/commit/d318cfc071b5e8d919b4c8acef89b85e8ef40cc8)
2323
- Optimized index loading and folder navigation [`0e6000f`](https://github.com/ollm/OpenComic/commit/0e6000f00e445de98eab7cdfbf72ee9b0016bf26)
24-
24+
- Error extracting files with 7zip if the file name contained UTF8 characters
2525

2626
## [v1.2.0](https://github.com/ollm/OpenComic/releases/tag/v1.2.0) (29-03-2024)
2727

scripts/file-manager.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1854,9 +1854,9 @@ var fileCompressed = function(path, _realPath = false, forceType = false, prefix
18541854
this.macosStartAccessingSecurityScopedResource(this.realPath);
18551855

18561856
if(extract)
1857-
this._7z = un7z.extractFull(this.realPath, this.tmp, {$bin: bin7z, $progress: true, $cherryPick: only});
1857+
this._7z = un7z.extractFull(this.realPath, this.tmp, {$bin: bin7z, $progress: true, $cherryPick: only, charset: 'UTF-8', listFileCharset: 'UTF-8'});
18581858
else
1859-
this._7z = un7z.list(this.realPath, {$bin: bin7z});
1859+
this._7z = un7z.list(this.realPath, {$bin: bin7z, charset: 'UTF-8', listFileCharset: 'UTF-8'});
18601860

18611861
return this._7z;
18621862

@@ -1947,7 +1947,7 @@ var fileCompressed = function(path, _realPath = false, forceType = false, prefix
19471947

19481948
_this.setProgress(1);
19491949

1950-
console.log('extract7z end:'+_this.path);
1950+
console.log('extract7z end: '+_this.path);
19511951

19521952
resolve();
19531953

0 commit comments

Comments
 (0)