Http://hi.baidu.com/linjk03/item/e2028bfd990c14ea1a111feb
Unified the input and output encoding format, there is no garbled problem arises. Specifies the encoding format when you construct reader or writer. in = new BufferedReader (New InputStreamReader (Socket.getinputstream (), "UTF-8"));
out = new BufferedWriter (New OutputStreamWriter (Socket.getoutputstream (), "UTF-8")); More articles: Socket Chinese garbled problem-http://hi.baidu.com/dearfenix/item/2a462a853732ced65f0ec123 "turn-summarize" IO stream basic knowledge and socket stream transmission garbled problem-http : A workaround for//aspnetdb.iteye.com/blog/973098java socket communication when Chinese characters are garbled-http://blog.csdn.net/mecho/article/details/ 7342654java socket receive Chinese garbled problem-http://hi.baidu.com/linjk03/item/e2028bfd990c14ea1a111feb
Java socket input and output Chinese garbled problem