using System;
class Program
{
static void Main() {
char[] char_array = { 'a', 'g', '\x6F' };
foreach (char ch in char_array) {
try {
byte b = Convert.ToByte(ch);
Console.WriteLine("{0} converted to {1}", ch, b);
}
catch (OverflowException) {
Console.WriteLine("Unable to convert");
}
}
}
}
/*
run:
a converted to 97
g converted to 103
o converted to 111
*/