Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CsvProvider encoding is not recognized #1453

Open
klinki opened this issue Jul 19, 2022 · 2 comments · May be fixed by #1503
Open

CsvProvider encoding is not recognized #1453

klinki opened this issue Jul 19, 2022 · 2 comments · May be fixed by #1503

Comments

@klinki
Copy link

klinki commented Jul 19, 2022

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?

@dsyme
Copy link
Contributor

dsyme commented Aug 17, 2022

I'm not actually sure. Perhaps we should just register all available encoding providers by default in the design-time component

@dsyme
Copy link
Contributor

dsyme commented Mar 11, 2024

A partial fix to this is here: #1503

An additional package needs to be referenced, or we must move to later .NET for the design time component

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants