Home  >  Q&A  >  body text

c++ - The send function in windows socket can only send char *, but my project encoding is unicode?

send(
    _In_ SOCKET s,
    _In_reads_bytes_(len) const char FAR * buf,
    _In_ int len,
    _In_ int flags
);

It is found that when it is converted into multi-byte transmission, the server side will have garbled characters. . .

迷茫迷茫2736 days ago806

reply all(1)I'll reply

  • 習慣沉默

    習慣沉默2017-05-16 13:23:36

    Does the server follow multi-byte decoding? If you want correct communication results, please ensure that the client and server use the same character encoding and decoding scheme

    reply
    0
  • Cancelreply