Bad encoding in HttpEntity
pI have read topics about it but can't get the response entity have a
utf-8 encoding. this is the code I use:/p
precoderequest.setHeader(User-Agent, USER_AGENT);
request.setHeader(Accept,
text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8);
request.setHeader(Accept-Charset, UTF-8); /code/pre pand then:/p
precodeBufferedReader rd = new BufferedReader(new
InputStreamReader(response .getEntity().getContent())); /code/pre pgives
unrecognized characters. BTW, the website I use displays the characters
correctly, so the problem is not in the server Thanks in advance/p pEDIT:
found an answer: a
href=http://stackoverflow.com/a/18434549/2719361http://stackoverflow.com/a/18434549/2719361/a
the problem was in my eclipse configurations./p
No comments:
Post a Comment