Return-Path: X-Original-To: apmail-hc-dev-archive@www.apache.org Delivered-To: apmail-hc-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D9B40C7DA for ; Tue, 23 Dec 2014 16:13:13 +0000 (UTC) Received: (qmail 92081 invoked by uid 500); 23 Dec 2014 16:13:13 -0000 Delivered-To: apmail-hc-dev-archive@hc.apache.org Received: (qmail 92032 invoked by uid 500); 23 Dec 2014 16:13:13 -0000 Mailing-List: contact dev-help@hc.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpComponents Project" Delivered-To: mailing list dev@hc.apache.org Received: (qmail 92014 invoked by uid 99); 23 Dec 2014 16:13:13 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 Dec 2014 16:13:13 +0000 Date: Tue, 23 Dec 2014 16:13:13 +0000 (UTC) From: "Oleg Kalnichevski (JIRA)" To: dev@hc.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Resolved] (HTTPCLIENT-1590) Chatset detection problem if Content-Type header is text/html MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HTTPCLIENT-1590?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Oleg Kalnichevski resolved HTTPCLIENT-1590. ------------------------------------------- Resolution: Invalid Tarik, HttpClient is content agnostic and is not supposed to infer encoding of the content body. It is supposed to return the content type info as _communicated_ by the origin server. You might want to have a look at Apache Tika Oleg > Chatset detection problem if Content-Type header is text/html > ------------------------------------------------------------- > > Key: HTTPCLIENT-1590 > URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1590 > Project: HttpComponents HttpClient > Issue Type: Bug > Affects Versions: 4.3.6 > Reporter: Tarik Yilmaz > > {code} > HttpClient client = HttpClients.createDefault(); > HttpEntity entity = client.execute(new HttpGet(url)).getEntity(); > String charset = ContentType.get(entity).getCharset().displayName(); > {code} > the third line throws an NullPointerException. > Response headers : > {code} > Cache-Control:private > Content-Encoding:gzip > Content-Length:16636 > Content-Type:text/html > Date:Tue, 23 Dec 2014 14:06:13 GMT > Server:Microsoft-IIS/7.0 > X-Powered-By:ASP.NET > {code} > Response meta tag : > {code} > > > > > > > {code} > How can I receive real charset from DOM object. -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org For additional commands, e-mail: dev-help@hc.apache.org