ZipFile读取方法不支持'IBM437'的编码名称 [英] 'IBM437' is not a supported encoding name from ZipFile Read Method

查看:613
本文介绍了ZipFile读取方法不支持'IBM437'的编码名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的代码使用以下代码执行此操作时遇到问题:

I have a problem when my code execute this using:

using (ZipFile archive = ZipFile.Read(File))    //<== Crash Here!
{
    foreach (ZipEntry entry in archive.Entries)
    {
        entry.Extract(UnZipFolder.Name.ToString(), ExtractExistingFileAction.OverwriteSilently);   
    }
}

当ZipFile尝试读取我的文件时崩溃字符串和包含在内,sincrofit.zip然后崩溃并引发此异常:

Crash when ZipFile try to read my File that it's a string and contains, sincrofit.zip then crash and throw this exception:


'System.ArgumentException'附加信息:'IBM437'不是
支持的编码名称。

'System.ArgumentException' Additional information: 'IBM437' is not a supported encoding name.


推荐答案

在Visual Studio中:

In Visual Studio:


  1. 打开Package Manager控制台,然后键入 Install-Package System.Text.Encoding.CodePages -Version 4.4.0

将此行添加到代码中: Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);

Add this line to your code: Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);

根据需要附加必要的指令。

Attach the necessary directive if required.

这篇关于ZipFile读取方法不支持'IBM437'的编码名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆