Skip to content

CsvProvider encoding is not recognized #1453

@klinki

Description

@klinki

Hello,

I'm trying to use CsvProvider with specified encoding, so the definition looks like this:

    type TradeRows = CsvProvider<csvDefinitionFile, Separators = ";", SkipRows = 3, HasHeaders = true, Encoding = "1250", Culture = "cs-CZ", IgnoreErrors = true>

but I'm getting following error during build:

No data is available for encoding 1250. For information on defining a custom encoding, see the documentation for the Encoding.RegisterProvider method.

Funny thing is this project works completely fine in Visual Studio, but I cannot build it with dotnet build or Rider.

I understand I have to register encodings with something like this:

Encoding.RegisterProvider CodePagesEncodingProvider.Instance

but how to do it so it is recognized by CsvProvider?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions