Java socket input and output Chinese garbled problem

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.