Encoding Problem with HttpClient

HttpClient looks very nice, as it supports many HTTP actions. I tried the webpage download code, but encountered an encoding issues with Chinese web pages.

Language encoding is always a problem for non-English developers, especially Asian developers, whose languages are encoded in 2 bytes for each character.

After playing with the source code for hours, I finally googled a very simple solution. Here it comes:

Though spent hours, I am very glad that the solution is very simple.

This entry was posted in java and tagged , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *


This site uses Akismet to reduce spam. Learn how your comment data is processed.