问题在扑朔迷离的应用程序中用特殊字符(在PDF中)解压缩PDF文件
请 我找不到可以解开带有pdf名称的PDF的.zip文件的解决方案,例如:
name.zip-> nâmé.pdf。
保存文件时,这不是我可以处理的,因为当我调用解码器时已经生成异常:
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);
在“ zipdecoder”中,thorw thorw a encode exceptions。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我用剥离特殊字符的正则态度解决了问题,从而在进行任何处理之前将文件重命名。
I solved the problem with a regex that strips the special characters, thus renaming the file before doing any processing.
像这样的init
somethin like this init