0

I found a question about how to convert ISO-8859-1 characters to entity number C# convert ISO-8859-1 characters to entity number code:

string input = "Steel Décor";
StringBuilder output = new StringBuilder();
foreach (char ch in input)
{
    if (ch > 0x7F)
    output.AppendFormat("&#{0};", (int) ch);
else
    output.Append(ch);
}
// output.ToString() == "Steel Décor"

but i didn't figure out how to do the opposite converting from entity number to character like from //"Steel Décor" to "Steel Décor"

ps: all accent character in my string are entity code

Community
  • 1
  • 1
Osdon
  • 126
  • 1
  • 14
  • Possible duplicate of [Using .NET how to convert ISO 8859-1 encoded text files that contain Latin-1 accented characters to UTF-8](http://stackoverflow.com/questions/2595442/using-net-how-to-convert-iso-8859-1-encoded-text-files-that-contain-latin-1-acc) – Eli Sadoff Nov 04 '16 at 04:26
  • With regular expressions? Just capture all `nnn` and replace. – zerkms Nov 04 '16 at 04:29
  • What you mean exactly by regular expressions ? any code explications ? – Osdon Nov 04 '16 at 04:33

0 Answers0