I'm working on receipt application on c#. I have receipt example with english and arabic words as in below.
I have json text and i try convert that json text to hex and sent as hex format via socket message. My problem is i try to convert text to Hex i cannot convert successfully. Here is how i convert text to Hex
string hexOutput = "";
byte[] ba = Encoding.Default.GetBytes(output);
hexOutput = BitConverter.ToString(ba);
hexOutput = hexOutput.Replace("-", "");
Here my json example
"PaymentReceipt":[
{
"DocumentQualifier":"CustomerReceipt",
"OutputContent":{
"OutputFormat":"Text",
"OutputText":[
{
"Text":"------------------------------------------------------------"
},
{
"Text":"XXXXXXXXXX2345"
},
{
"Text":"Purchase Amount مبلغ الشراء"
},
{
"Text":"5.00"
},
{
"Text":""
},
{
"Text":"Thanks for your visit شكرا لزيارتكم"
}
]
What can i do for correctly convert text to HEX?