CsvProvider encoding is not recognized
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?
I'm not actually sure. Perhaps we should just register all available encoding providers by default in the design-time component
A partial fix to this is here: https://github.com/fsprojects/FSharp.Data/pull/1503
An additional package needs to be referenced, or we must move to later .NET for the design time component