Here’s a C# example program to convert from iso-8859-1 to utf-8:
// Convert iso-8859-1 to utf-8.
// C# strings are Unicode, so we must first get a byte
// array containing iso-8859-1 bytes.
System.Text.Encoding iso_8859_1 = System.Text.Encoding.GetEncoding("iso-8859-1");
System.Text.Encoding utf_8 = System.Text.Encoding.UTF8;
// This is our Unicode string:
string s_unicode = "abcéabc";
// Convert it to iso-8859-1 bytes
byte[] isoBytes = iso_8859_1.GetBytes(s_unicode);
// Convert the bytes to utf-8:
byte[] utf8Bytes = System.Text.Encoding.Convert(iso_8859_1, utf_8, isoBytes);
// Let's examine both byte arrays as hex strings.
// We're using Chilkat.Crypt2 for simplicity...
Chilkat.Crypt2 crypt = new Chilkat.Crypt2();
textBox1.Text = crypt.Encode(isoBytes, "hex");
textBox2.Text = crypt.Encode(utf8Bytes, "hex");
// The result is this:
// isoBytes = 616263<strong>E9</strong>616263
// utf8Bytes = 616263<strong>C3A9</strong>616263
// The é character is 0xE9 in iso-8859-1, but is represented
// as two bytes (0xC3 0xA9) in utf-8.