第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

Encoding 字符編碼的問題

Encoding 字符編碼的問題

C#
牧羊人nacy 2018-12-12 14:08:16
socket.send 發(fā)送的字符串,如下 <br> strS = "6800000000000068010243C3D916" <br> Byte[] bytesSent = Encoding.Unicode.GetBytes(strS); <br> socket.Send(bytesSent, bytesSent.Length, 0); <br> <br> <br> 接收到的怎么是些這樣的內(nèi)容。而不是我發(fā)送的包. <br> 用別的測試工具發(fā)下去,接收的顯示正常。 <br> &lt; &lt;--服務(wù)器已收到:(56)6 <br> &lt; &lt;--36&nbsp; 00&nbsp; 38&nbsp; 00&nbsp; 30&nbsp; 00&nbsp; 30&nbsp; 00&nbsp; 30&nbsp; 00&nbsp; 30&nbsp; 00&nbsp; 30&nbsp; 00&nbsp; 30&nbsp; 00&nbsp; 30&nbsp; 00&nbsp; 30&nbsp; 00&nbsp; 30&nbsp; 00&nbsp; 30&nbsp; 00&nbsp; 30&nbsp; 00&nbsp; 30&nbsp; 00&nbsp; 36&nbsp; 00&nbsp; 38&nbsp; 00&nbsp; 30&nbsp; 00&nbsp; 31&nbsp; 00&nbsp; 30&nbsp; 00&nbsp; 32&nbsp; 00&nbsp; 34&nbsp; 00&nbsp; 33&nbsp; 00&nbsp; 43&nbsp; 00&nbsp; 33&nbsp; 00&nbsp; 44&nbsp; 00&nbsp; 39&nbsp; 00&nbsp; 31&nbsp; 00&nbsp; 36&nbsp; 00&nbsp; <br> <br> <br> 可能是Encoding轉(zhuǎn)換有問題,C#能用的編碼都試了,還是不行。誰知道請指教,多謝了。 <br> Encoding.Unicode <br> ASCII <br> Default <br> UTF32 <br> UTF8 <br> UTF7 <br> 這些都試過,不行。
查看完整描述

2 回答

?
慕碼人8056858

TA貢獻(xiàn)1803條經(jīng)驗(yàn) 獲得超6個贊

36 00 38 00 30 00 30 00 30 00 30 00 30 00 30 00 30 00 30 00 30 00 30 00 30 00 30 00 36 00 38 00 30 00 31 00 30 00 32 00 34 00 33 00 43 00 33 00 44 00 39 00 31 00 36 00 這個序列是你服務(wù)器打印的還是其他工具打印的?這個序列是正確的,和下面代碼轉(zhuǎn)換 出來的字節(jié)序列是一樣的。只不過是16進(jìn)制表示。 strS = "6800000000000068010243C3D916" Byte[] bytesSent = Encoding.Unicode.GetBytes(strS);

查看完整回答
反對 回復(fù) 2018-12-16
?
湖上湖

TA貢獻(xiàn)2003條經(jīng)驗(yàn) 獲得超2個贊

Encoding.Unicode 的意思,好象是 UTF16, 每個字符,不論中英文,都是用兩位 byte 來表示。

老兄的意思,可能是要用 Encoding.UTF8 來處理。


查看完整回答
反對 回復(fù) 2018-12-16
  • 2 回答
  • 0 關(guān)注
  • 751 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號