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?

Answers


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);

Need Your Help

jQuery not recognising change of class on element

javascript jquery html css

OK so I made a custom function which I can then call using a div's class.

Importing library in Dart on Windows

import dart

I've been trying to make a library in Dart and import it in my project. Though for some reason it won't do it.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.