'Problem unzipping pdf file with special character (in pdf) in a flutter application
please I'm not able to find a solution to unzip a .zip file that has a pdf with accent in name, something like:
name.zip -> nâmé.pdf.
It's not something I can handle when saving the file because the exception is already generated when I call decoder:
import 'package:archive/archive.dart';
final zipFile = File(await projectFilePath() + zipFilename);
final destinationDir = Directory(await projectUnzipFilePath()).path;
// Read the Zip file from disk.
final bytes = zipFile.readAsBytesSync();
// Decode the Zip file
final archive = ZipDecoder().decodeBytes(bytes);
In "ZipDecoder" thorw a Encode exception.
Solution 1:[1]
somethin like this init
try {
// code that might throw an exception
}
catch(e){
// code for handling exception
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | mister_cool_beans |
