String needs to be Basic Latin and Latin 1 only

Hi all,

I have a string of text that can contain anything, and I need to send to an API using only Unicode characters from BasicLatin and Latin-1Supplement.
I’ve seen errors where people have included the backtick character for example. Is there a way that I can quickly convert a string to this format? I can use Regex to strip characters out, but I would like to be able to convert backtick to apostrophe etc.

All ideas welcome.

Hi @JohnMac

Have you looked into the .NET Encoding class?

There are a variety of functions, one for example Encoding.Convert with specified character sets. I haven’t personally indulged in it before so I couldn’t offer any further help.

Kind Regards

1 Like

maybe same approach will work after some adoptions on the different encodings:

If it is not working then just share with us the input and expected output string

1 Like

Some more research and I found that it wasn’t the backtick that was the issue, as that is part of Latin1. It was character 8217: ’
encoding.convert would probably work fine, but I downloaded a package from the UiPathTeam UiPathTeam.Encoding.Activities which does the job, and is probably easier to understand for anyone who looks at my process later and tries to work out what it all does :slight_smile:


Thanks @Che and @ppr !

1 Like

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