I need to Convert greek characters as charmap terminal font hex value.
Example how can i convert
string test="ΞΥΔΙ";
to hex value "\0x8D.......and so on.
If will Convert from String to Hex i'm getting wrong hex value
byte[] ba = Encoding.GetEncoding(1253).GetBytes("ΨΓΣΦ");
var hexString = BitConverter.ToString(ba);
MessageBox.Show(hexString);
Example from character 'Ξ' i'm getting 0xCE
You are close:
String.Join
Something like this:
// Terminal uses MS DOS Code Page which is 737 (not Win-1253)
byte[] ba = Encoding.GetEncoding(737).GetBytes("ΞΥΔΙ");
// Let's use Linq to print out a test
var hexString = string.Join(" ", ba.Select(c => $"0x{(int)c:X2}"));
Console.Write(hexString);
Outcome:
0x8D 0x93 0x83 0x88
Please, notice that Ξ
has 0x8D
code.