.Net Core报“‘GB2312‘ is not a supported encoding name. For information on defining a custom encod”的错误
1、问题描述
在.Net Core中使用Encoding.GetEncoding("GB2312")报如下错误:
System.ArgumentException:“'GB2312' is not a supported encoding name. For information on defining a custom encoding, see the documentation for the Encoding.RegisterProvider method. Arg_ParamName_Name”

2、解决办法
在NuGet中下载“System.Text.Encoding.CodePages”包:

然后在var bytes = Encoding.GetEncoding("GB2312").GetBytes(strTemp);之前注册对编码进行注册:Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);

到此,问题解决!
.Net Core报“‘GB2312‘ is not a supported encoding name. For information on defining a custom encod”的错误的更多相关文章
- .Net Core 遇到 “'windows-1252' is not a supported encoding name.”
使用iTextSharp生成Pdf文件时报错如下: 'windows-1252' is not a supported encoding name. For information on defini ...
- .Net Core 遇到 “'windows-1252' is not a supported encoding name.”
最近用 iTextSharp 拆分 Pdf 文档 加水印的时候遇到错误: 'windows-1252' is not a supported encoding name. For informatio ...
- 如何让.NET Core支持GB2312和GBK
在.NET Core中,默认是不支持GB2312和GBK编码的. 例如我们如果新建一个.NET Core控制台项目,然后在其Main方法中使用如下代码: using System; using Sys ...
- 保存xml报错 'UTF_8' is not a supported encoding name
ArgumentException: 'UTF_8' is not a supported encoding name. For information on defining a custom en ...
- Putty使用公钥认证时,报错:Disconnected: No supported authentication methods available(server sent:public key) 问题的解决
Putty使用公钥认证时,按照常规方法设置,一直报错:Disconnected: No supported authentication methods available (server sent: ...
- input()报错:TypeError: '>=' not supported between instances of 'str' and 'int'
今天学习python基础—分支与循环,接触到了if.在练习一个if语句的时候,出现了错误. 题目是: 根据分数划分成四个级别:优秀.良好.及格.不及格,分数是72: grade = 72if grad ...
- Maven工程 报 Diamond types are not supported at language level '5'
Maven工程 报 Diamond types are not supported at language level '5' 出现这种信息,一般表示的是你的language level(IDEA下J ...
- (TODO:)下载图片,报错:warning: could not load any Objective-C class information from the dyld shared cache. This will significantly reduce the quality of type information available.
想使用NSInvocationOperation下载图片,然而并没有下载下来, NSData为nil, 还有报错:(打断点就报错) warning: could not load any Object ...
- WCF服务接口多,客户端在引用时出错!报WCF The maximum nametable character count quota (16384) has been exceeded while reading XML data错误
WCF服务接口多,客户端在引用时出错!报WCF The maximum nametable character count quota (16384) has been exceeded while ...
- zookeeper报错java.net.ConnectException: Connection refused: no further information
zookeeper报错java.net.ConnectException: Connection refused: no further information 这是在linux 启动 https:/ ...
随机推荐
- OSG开发笔记(三十四): OsgUtil::Simplifier:简化几何体,提升显示性能和渲染效率
前言 对于一些较大的图形,会出现显示卡顿和渲染缓慢的问题,这时候就要使用到osgUtil::Simplifier简化器,来对其进行简化. Demo osgUtil o ...
- python爬虫利器之Playwright
Playwright 是微软在 2020 年初开源的新一代自动化测试工具,它的功能类似于 Selenium.Pyppeteer 等,都可以驱动浏览器进行各种自动化操作.它的功能也非常强大,对市面上的主 ...
- MySQL底层概述—1.InnoDB内存结构
大纲 1.InnoDB引擎架构 2.Buffer Pool 3.Page管理机制之Page页分类 4.Page管理机制之Page页管理 5.Change Buffer 6.Log Buffer 1.I ...
- go 编译超时解决
转载请注明出处: 在编译go项目时,遇到依赖下载超时,异常输出如下: CGO_ENABLED=0 GOOS=linux GO111MODULE=on go build -a -ldflags '-ex ...
- .NET 中的中间件(Middleware)
ASP.NET Core 中间件 什么是中间件(Middleware)? 中间件是组装到应用程序管道中以处理请求和响应的软件. 每个组件: 选择是否将请求传递给管道中的下一个组件. 可以在调用管道中的 ...
- Mplus数据分析:性别差异gendergap的相关研究如何做?
再出一篇用mplus做的多组比较和中介分析的文章,专门谈谈诸如性别差异的各种研究的分析方法,从本文中大家不止可以知道性别差异,各种差异,各种gap只要你感兴趣都可以套进来这个方法来进行你的研究设计. ...
- IOS热重载工具InjectionIII
IOS热重载工具InjectionIII 支持 OC.Swift 以及 Swift 和 OC 混编项目的 UI 热重载工具,采取在模拟器(真机不支持)注入方式实现 UI 热重载,修改完 UI 直接 c ...
- [转载] 十问 TiDB :关于架构设计的一些思考 TiDB
做 TiDB 的缘起是从思考一个问题开始的:为什么在数据库领域有这么多永远也躲不开的坑?从 2015 年我们写下第一行代码,3 年以来我们迎面遇到无数个问题,一边思考一边做,尽量用最小的代价来快速奔跑 ...
- Kubernetes 服务发现 监控Endpoints
监控 Pod之前的apiserver 实际上就是一种特殊的 Endpoints,现在我们同样来配置一个任务用来专门发现普通类型的 Endpoint,其实就是 Service 关联的 Pod 列表,由于 ...
- docker-entrypoint.sh 文件的用处
参考出处很多著名库的 Dockerfile 文件中,通常都是 ENTRYPOINT 字段会是这样: ENTRYPOINT ["docker-entrypoint.sh"]这里我们参 ...