title: Chinese character strings transmitted between client and server garbled
body: <p>i'm writing a simple client/server program. Basically, the client sends a query string to the server and the server sends back an answer in the form of a character string, too. The server is written in C++ using the socket-based boost/asio library. The server is written on a Linux box (Fedora 25). The client is written in Java. Everything works except when I installed the client on a Windows machine when I noticed the query string (in Chinese) was garbled at the server end. Do not have this problem when client is also on Linux. </p>
  
  <pre><code>socket = new Socket(host, port);
  BufferedReader in = new BufferedReader(new 
  InputStreamReader(socket.getInputStream()));
  PrintWriter out = new PrintWriter(socket.getOutputStream(), true);
  out.println(inputStr);
  resultStr = in.readLine();
  </code></pre>
  
  <p>Above is the client part java code. The server C++ code for receiving the query string is:</p>
  
  <pre><code>ProcessRequest(asio::streambuf&amp; request){ 
  std::string input = to_string(request);
  std::cout &lt;&lt; input &lt;&lt; std::endl;
  ...
  </code></pre>
  
  <p>Here I noticed that when client was run from a windows machine, the received Chinese query string was all garbage.</p>
  
  <p>Again, when client was run from a Linux box, no problem.</p>