diff --git a/src/main/java/Diadoc/Api/httpClient/DiadocHttpClient.java b/src/main/java/Diadoc/Api/httpClient/DiadocHttpClient.java index a59ea39f..82826ced 100644 --- a/src/main/java/Diadoc/Api/httpClient/DiadocHttpClient.java +++ b/src/main/java/Diadoc/Api/httpClient/DiadocHttpClient.java @@ -30,6 +30,7 @@ import javax.mail.internet.ParseException; import java.io.IOException; import java.net.URISyntaxException; +import java.nio.charset.StandardCharsets; import java.security.KeyManagementException; import java.security.KeyStoreException; import java.security.NoSuchAlgorithmException; @@ -112,7 +113,7 @@ private byte[] getResponseBytes(HttpResponse response) throws IOException { if (response.getStatusLine().getStatusCode() != HttpStatus.SC_OK) { throw new HttpResponseException( response.getStatusLine().getStatusCode(), - new String(IOUtils.toByteArray(response.getEntity().getContent()))); + new String(IOUtils.toByteArray(response.getEntity().getContent()), StandardCharsets.UTF_8)); } return IOUtils.toByteArray(response.getEntity().getContent()); } @@ -121,7 +122,7 @@ private DiadocResponseInfo getResponse(HttpResponse response) throws IOException if (response.getStatusLine().getStatusCode() != HttpStatus.SC_OK) { return DiadocResponseInfo.fail( response.getStatusLine().getStatusCode(), - new String(IOUtils.toByteArray(response.getEntity().getContent())), + new String(IOUtils.toByteArray(response.getEntity().getContent()), StandardCharsets.UTF_8), tryGetRetryAfter(response)); } return DiadocResponseInfo.success(IOUtils.toByteArray(response.getEntity().getContent()), response.getStatusLine().getStatusCode());