You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@jclouds.apache.org by GitBox <gi...@apache.org> on 2019/08/14 17:08:43 UTC

[GitHub] [jclouds] gaul commented on a change in pull request #41: JCLOUDS-1510: ParseSax use charset constant for all String creations

gaul commented on a change in pull request #41: JCLOUDS-1510: ParseSax use charset constant for all String creations
URL: https://github.com/apache/jclouds/pull/41#discussion_r313985447
 
 

 ##########
 File path: core/src/main/java/org/jclouds/http/functions/ParseSax.java
 ##########
 @@ -93,7 +94,7 @@ private T convertStreamToStringAndParse(HttpResponse response) {
       String from = null;
       try {
          byte[] fromBytes = closeClientButKeepContentStream(response);
-         from = new String(fromBytes);
+         from = new String(fromBytes, StandardCharsets.UTF_8);
 
 Review comment:
   I think this would be more correct to use the charset from the Content-Type header.  However I doubt any provider use charsets other than UTF-8 or ASCII?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services