我试过这个:
byte[] buffer = (byte[])mf.Input;
//Here, the buffer comes from a serial input
string result = System.Text.Encoding.UTF8.GetString(buffer)
string result2 = System.Text.Encoding.ASCII.GetString(buffer);
和其他一些类似的方法。但它会返回一些奇怪的字符......我该如何真正转换它?
这是我得到的值:“???3?&?5?”
并且假设返回我一个Card ID
值,如B54A7WQ912
缓冲区值是:`缓冲区{byte [12]}
[0]168
[1]63
[2]18
[3]63
[4]21
[5]...
[6]....
[7]....
[8]...
[9]...
[10]...
[11]...
每一个都有一个值。
更新
现在我可以Write/Read
进出RFID
Mifare 卡了。但是像这样的特殊字符á,ã,à,è
没有显示,而是显示?
。我该如何解决?谢谢 !
Obs:我正在使用上面的方法/\