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

 ##########
 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:
   Probably not, but I can't say for sure.
   I can get the charset from the Content-Type header (if it exists there) - 
are there some HTTP utilities already in the classpath I can use to avoid 
parsing the Content-Type string myself?

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to