You don't need an hex representation of a char, just a conversion to an integer could be enough
char c = '\n';
int ascii_n = (int)c;
Console.WriteLine(ascii_n); // = 10
also for char higher than 255
char c = '∙';
int a = (int)c;
Console.WriteLine(a); // = 8729