dhbaird / easywsclient

A short and sweet WebSocket client for C++
MIT License
741 stars 205 forks source link

encoding #54

Closed Blankeer closed 5 years ago

Blankeer commented 8 years ago

encoding Chinese

ws->send("哈哈");

node.js console:

����

thinks.

fwanggg commented 7 years ago

if you are on windows, you have to use wchar to store "哈哈" and convert it to utf-8 char* string then call ws->send(utf8_str);

lighterowl commented 5 years ago

This library is completely agnostic to encoding issues, and takes all the data thrown at it as binary, without taking care to encode it to UTF-8. Thus, it is your responsibility to encode it before calling send(). The example you've provided is not sufficient because - without the exact compiler and platform version - we have no idea what "哈哈" resolves to.