1

Does anyone know how to convert a string in C# that has UTF-8 hexadecimal characters in it to a regular characters.?

For example

hell%c3%b3 to hello

Chart

UTF-8      ASCII     TECKEN   Flattened
%c3%b3     %f3       ò        o

There are many UTF-8 hexadecimals I need to convert is there a way to do this with a built in method in .NET?

Thomas Weller
  • 55,411
  • 20
  • 125
  • 222
Leslie Jones
  • 540
  • 2
  • 9
  • 22

1 Answers1

3

This is called URL encoding and can be undone with

using System.Web;
HttpUtility.UrlDecode("hell%c3%b3");

This gives helló, but probably that's what you wanted.

The second part, removing the diacritics, is not so simple, see How do I remove diacritics here on SO.

Community
  • 1
  • 1
Thomas Weller
  • 55,411
  • 20
  • 125
  • 222