After upgrading to ASP.NET Core 2.1 (.NET Core SDK 2.1.301), you may encounter the following error about encoding:

System.ArgumentException
   HResult=0x80070057
   Message='Cyrillic' is not a supported encoding name. For information on defining a custom encoding, see the documentation for the Encoding.RegisterProvider method.
   Source=System.Private.CoreLib
   StackTrace:
    at System.Text.EncodingTable.internalGetCodePageFromName(String name)
    at System.Text.EncodingTable.GetCodePageFromName(String name)
    at System.Text.Encoding.GetEncoding(String name)

The error message itself already provides the solution.

To resolve the issue, add package reference System.Text.Encoding.CodePages.

And then register code page encoding provider via Encoding.RegisterProvider method.

public void ConfigureServices(IServiceCollection services)
 {
// …
// Register code Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
}
info Last modified by Raymond at 6 months ago copyright This page is subject to Site terms.

More from Kontext

local_offer spark local_offer pyspark

visibility 4495
thumb_up 0
access_time 2 years ago

When creating Spark date frame using schemas, you may encounter errors about “field **: **Type can not accept object ** in type <class '*'>”. The actual error can vary, for instances, the following are some examples: field xxx: BooleanType can not accept object 100 in type ...

open_in_new Spark + PySpark

local_offer hive

visibility 1878
thumb_up 0
access_time 2 years ago

Since Hive 3.x, new authentication feature for HiveServer2 client is added. When starting HiveServer2 service (Hive version 3.0.0), you may encounter errors like: ‘HiveServer2 metastore.RetryingMetaStoreClient: RetryingMetaStoreClient trying reconnect as [username]  (auth:S...

open_in_new Hadoop

local_offer linux local_offer WSL local_offer ubuntu

visibility 7136
thumb_up 4
access_time 2 years ago

This page shows how to install Windows Subsystem for Linux (WSL) system on a non-system drive manually. Enable Windows Subsystem for Linux system feature Open PowerShell as Administrator and run the following command to enable WSL feature: Enable-WindowsOptionalFea...

open_in_new Tools

local_offer kontext

visibility 70
thumb_up 0
access_time 2 years ago

In the past months, this website has been using the following Email address to delivery all the notification messages to the website users such as registration confirmation email, comment email and so on. no-reply[at]kontext.tech However, I recently fou...

open_in_new Kontext Information

comment Comments (0)

comment Add comment

Please log in or register to comment.

account_circle Log in person_add Register

Log in with external accounts

No comments yet.

Kontext Column

Created for everyone to publish data, programming and cloud related articles. Follow three steps to create your columns.


Learn more arrow_forward