Write CSV with encoding fail

Hi Everyone,

I’m trying to write a csv file with WriteCsvFile Activity using encoding “iso-8859-15”.
But I’ve an error on execution.

“Ecrire fichier CSV: ‘iso-8859-15’ is not a supported encoding name. For information on defining a custom encoding, see the documentation for the Encoding.RegisterProvider method. (Parameter ‘name’)”

I’ve tried “iso-8859-1”, “ASCII-us” but I have the same error.
I’m using Studio 2023.4.2

Regards

Hi

The error you’re encountering is because the “iso-8859-15” encoding is not supported directly in UiPath’s Write CSV activity.
U can check this doc
https://docs.uipath.com/activities/other/latest/workflow/supported-character-encoding

Hope this clarifies

Cheers @Romain_80000

The error message indicates that “iso-8859-15” is not a supported encoding name. This is because the .NET Framework used by UiPath may not include this specific encoding by default.

you can try the following steps… Hope may help

1.Use a Supported Encoding: Instead of “iso-8859-15,” try using a supported encoding like “ISO-8859-1” (also known as Latin-1) which is more commonly available

2.Use “Windows-1252” Encoding: If ISO-8859-1 doesn’t work, you can try using “Windows-1252” encoding, which is similar to ISO-8859-1.

3.Custom Encoding: If you absolutely need to use “iso-8859-15” and it’s not available by default, you may need to create a custom encoding provider using Encoding.RegisterProvider as suggested in the error message. However, this is a more advanced step and may require coding expertise.

Here’s an example of how you might use “ISO-8859-1” encoding in UiPath:

Encoding.GetEncoding(“ISO-8859-1”).GetString(yourBytes)

@Romain_80000

Tracker:

Workaround, when an UiPath.System.Activities / UiPath.Excel.Activities Package Version is used, which has not already adapted:
2.11 Unsupported specific character encoding

Hi,

Can you try to call System.Text.Encoding.RegisterProvider(System.Text.CodePagesEncodingProvider.Instance) using InvokeMethod as the following sample?

Sample20230926-1.zip (3.0 KB)

Regards,

Thank you all for your help.

@Praveen_Mudhiraj
Do you have an example of using Encoding.RegisterProvider in C#.

@Yoichi
Thanks but I have a compilation error. I’m in C# maybe that’s the cause. Do you have the same thing in C#?

HI,

How about the following?

Sample
Sample20230925-1CS.zip (3.2 KB)

Regards,

@Yoichi

Thank you very much, I understand, if we copy and paste the method it does not put the references in the workflow.
Typing by hand solved the problem.

どうもありがとう

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.