[ https://issues.apache.org/jira/browse/HTTPCORE-431?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15458269#comment-15458269 ]
ASF GitHub Bot commented on HTTPCORE-431: ----------------------------------------- Github user hirthwork commented on the issue: https://github.com/apache/httpcore/pull/30 1. This code makes no distinction between BE and LE encodings described in [rfc4627](https://tools.ietf.org/html/rfc4627#section-3). 2. [rfc7159](https://tools.ietf.org/html/rfc7159#section-8.1) explicitly forbids byte order marks, while this patch depends on BOMs. IMHO, workarounds for improper servers should not be injected in core functionality. Probably, separate function like EntityUtils.safeJsonToString(...) should be introduced, so anybody using this function will be informed than slight performance penalty will apply. > 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-unsubscr...@hc.apache.org For additional commands, e-mail: dev-h...@hc.apache.org