Persian text box to hex to byte
hi I have some text boxes which user enters information such as first name,last name ,... . I need to convert text boxes' text to hex and then convert the hex to bytes and send to device via rs232.
I know the sending via rs232 part and I also know how to convert text to bytes.
My problem is ,now, I should work with Persian characters in text boxes .It means the text for name in text box would for example like this "حسین".
How can I solve my problem?
If i understand correctly you can try something like that
byte yourStrBytes = Encoding.GetEncoding("your encoding").GetBytes("your str"); string hexStr = BitConverter.ToString(yourStrBytes).Replace("-", ""); byte hexStrBytes=Encoding.UTF8.GetBytes(hexStr);