Home  >  Article  >  Backend Development  >  c#-php socket_read() 接受C# 发送的字节数组 byte[] ,汉字出现乱码。

c#-php socket_read() 接受C# 发送的字节数组 byte[] ,汉字出现乱码。

WBOY
WBOYOriginal
2016-06-02 11:27:571349browse

乱码c#socketphp

如标题,在C#中,用系统函数
socket.BeginReceive(resultByte, 0, resultByte.Length, System.Net.Sockets.SocketFlags.None, new AsyncCallback(this.OnDataReceived), socket);
resultString = Encoding.Unicode.GetString(resultByte, 0, Count);

<code>            这个resultString是正常接收返回,但是PHP中用socket_read()读取出来的确有乱码问题,可能是中文编码的问题。            求大神该怎么解决啊?</code>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn