hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HTTPCORE-431) Correct character encoding default for application/json
Date Fri, 02 Sep 2016 10:39:22 GMT

    [ https://issues.apache.org/jira/browse/HTTPCORE-431?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15458184#comment-15458184
] 

ASF GitHub Bot commented on HTTPCORE-431:
-----------------------------------------

Github user pauldraper commented on a diff in the pull request:

    https://github.com/apache/httpcore/pull/30#discussion_r77326982
  
    --- Diff: httpcore/src/main/java/org/apache/http/Consts.java ---
    @@ -42,6 +42,8 @@
         public static final int HT = 9;  // <US-ASCII HT, horizontal-tab (9)>
     
         public static final Charset UTF_8 = Charset.forName("UTF-8");
    +    public static final Charset UTF_16 = Charset.forName("UTF-16");
    +    public static final Charset UTF_32 = Charset.forName("UTF-32");
    --- End diff --
    
    FYI, UTF-32 has not been included in Java 7's `StandardCharsets`.
    
    AFAIK all Java installations support it, but I could better handle that error if missing
UTF-32 support is a concern.


> Correct character encoding default for application/json
> -------------------------------------------------------
>
>                 Key: HTTPCORE-431
>                 URL: https://issues.apache.org/jira/browse/HTTPCORE-431
>             Project: HttpComponents HttpCore
>          Issue Type: Improvement
>          Components: HttpCore
>            Reporter: Paul Draper
>            Priority: Minor
>
> RFC 4627 and RFC 7159 require that parsers auto-detect the encoding of application/json.
UTF-8 is the suggested default, though it's possible to detect the encoding of valid JSON
unambiguously.
> Currently, EntityUtils.toString defaults to ISO-8859-1 (the default for text formats
without a charset parameter).
> Given how common application/json is, it would be great for EntityUtils.toString to use
the correct encoding.



--
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


Mime
View raw message