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”的错误的更多相关文章

  1. .Net Core 遇到 “'windows-1252' is not a supported encoding name.”

    使用iTextSharp生成Pdf文件时报错如下: 'windows-1252' is not a supported encoding name. For information on defini ...

  2. .Net Core 遇到 “'windows-1252' is not a supported encoding name.”

    最近用 iTextSharp 拆分 Pdf 文档 加水印的时候遇到错误: 'windows-1252' is not a supported encoding name. For informatio ...

  3. 如何让.NET Core支持GB2312和GBK

    在.NET Core中,默认是不支持GB2312和GBK编码的. 例如我们如果新建一个.NET Core控制台项目,然后在其Main方法中使用如下代码: using System; using Sys ...

  4. 保存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 ...

  5. Putty使用公钥认证时,报错:Disconnected: No supported authentication methods available(server sent:public key) 问题的解决

    Putty使用公钥认证时,按照常规方法设置,一直报错:Disconnected: No supported authentication methods available (server sent: ...

  6. input()报错:TypeError: '>=' not supported between instances of 'str' and 'int'

    今天学习python基础—分支与循环,接触到了if.在练习一个if语句的时候,出现了错误. 题目是: 根据分数划分成四个级别:优秀.良好.及格.不及格,分数是72: grade = 72if grad ...

  7. Maven工程 报 Diamond types are not supported at language level '5'

    Maven工程 报 Diamond types are not supported at language level '5' 出现这种信息,一般表示的是你的language level(IDEA下J ...

  8. (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 ...

  9. 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 ...

  10. zookeeper报错java.net.ConnectException: Connection refused: no further information

    zookeeper报错java.net.ConnectException: Connection refused: no further information 这是在linux 启动 https:/ ...

随机推荐

  1. Rework:每个程序员都应该读的一本书

    来源: 萌萌的博客 每一个程序员都有改变世界的梦想,他们不甘平凡,他们想要与众不同,他们想要创立世界上最酷的公司,那具体该如何做呢?风靡全球的<Rework>将告诉你答案. 37signa ...

  2. 2024年值得推荐的6款 Vue 后台管理系统模板,开源且免费!

    前言 在现今的软件开发领域,Vue.js凭借其高效.灵活和易于上手的特性,成为了前端开发的热门选择.对于需要快速搭建企业级后台管理系统的开发者而言,使用现成的Vue后台管理系统模板无疑是一个明智之举. ...

  3. PYENV安装与使用

    1.概述 pyenv 是一个python的版本管理软件,通过他,我们可以 方便的安装python 的版本,切换版本,解决版本不同带来问题. 2.安装pyenv 我们可以通过链接下载pyenv http ...

  4. 『玩转Streamlit』--表单Form

    在Streamlit中,Form组件是一种特殊的UI元素,允许用户输入数据而不立即触发应用的重新运行. 这对于创建需要用户输入多个参数后再进行处理的交互式表单非常有用. 1. 概要 Form组件的主要 ...

  5. ZCMU-1033

    我觉得这位大佬说的已经很好了,可以直接看她的思路了: 大佬思路 但是她的代码没有考虑到1 1 1 1的情况, 代码思路 这个是可以的很长且没有注释: #include<bits/stdc++.h ...

  6. Node.js Express 框架(1)

    1.Express介绍 Express 是一个简洁而灵活的 node.js Web应用框架, 提供了一系列强大特性帮助你创建各种 Web 应用,和丰富的 HTTP 工具. Express的特点: 实现 ...

  7. Fiddler抓包iOS手机配置全流程

    前情 平时做移动移动端开必的时候经常需要抓包手机,用于接口请求跟踪,但iOS的抓包经常性的配不成功,经过踩过不少坑后终于知道了整个配置流程,此文记录Fiddler抓包iOS手机的配置流程. Step ...

  8. postman -- 把上一接口的响应值作为下一接口的入参

    一.方法

  9. Ubuntu 的网络图标不见了,怎么解决

    1. 问题 Ubuntu 的网络图标不见了 2. 解决 service network-manager status # 此时,你会发现状态是 active(running),不用管 service ...

  10. Mac触控板设置以及使用

    Mac 触控板体验是非常好的,很多同学甚至直接用触控板代替鼠标操作,但是默认设置中有一些功能是没有开启的,需要手动配置. 本文就来说说 如何更改 Mac 触控板默认设置,让触控板变得更高效. 一.启用 ...