No Data Is Available For Encoding 1252 Error After Converting Project From Legacy To Windows

How to solve the error "No data is available for encoding 1252. For information on defining a custom encoding, see the documentation for the Encoding.RegisterProvider method" after converting a project from the Legacy to the Windows compatibility?

Issue Description:

Error "No data is available for encoding 1252. For information on defining a custom encoding, see the documentation for the Encoding.RegisterProvider method" after converting a project from the Legacy to the Windows compatibility.

The error can also appear in the form "XXX is not a supported encoding name":


Resolution:
Register the encoding provider by placing an Invoke Method activity before the activity that generated the error (e.g. Assign) and configure it as per below:

  • set TargetType to System.Text.Encoding
  • set MethodName to RegisterProvider
  • click on the "..." in front of the Parameters property
  • inside the Parameters window, set EncodingProvider as the Type
  • enter System.Text.CodePagesEncodingProvider.Instance as the Value

Example: