2010-01-21 334 views

回答

8

我找到了解決方案。

長度錯了。在代碼中,我們在計數之前傳遞字符串的長度。我們應該在UTF編碼之後進行計數:

writer.Write((byte)0); //First byte of payload length; (big-endian first byte) 
enter code herebyte[] b1 = System.Text.Encoding.UTF8.GetBytes(payload); 
writer.Write((byte)b1.Length);  //payload length (big-endian second byte) 
+0

你是對的,謝謝 – Meir 2011-02-21 12:29:52

+0

非常感謝,它會花費我很多工作。 – LolaRun 2011-06-02 15:22:58

+0

@Meir您能否告訴我如何通過Xcode在應用程序端管理這些非英文消息?你有沒有爲應用程序做過其他語言設置? – 2013-08-23 07:32:25

相關問題