Skip to content

Commit 0e71fb3

Browse files
Revert "Cherry pick branch 'genexuslabs:tomas-sexenian-patch-1' into beta"
This reverts commit c3d6a9d.
1 parent 89c12a6 commit 0e71fb3

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

java/src/main/java/com/genexus/internet/HttpClientJavaLib.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -708,14 +708,15 @@ private void setEntityReader() throws IOException {
708708
}
709709

710710
public String getString() {
711-
if (response == null) return "";
711+
if (response == null)
712+
return "";
712713
try {
713714
this.setEntity();
714-
byte[] bytes = EntityUtils.toByteArray(entity);
715715
Charset charset = ContentType.getOrDefault(entity).getCharset();
716-
String res = new String(bytes, charset);
717-
if (res.matches(".*[Ã-ÿ].*"))
718-
res = new String(bytes, StandardCharsets.UTF_8);
716+
String res = EntityUtils.toString(entity, charset);
717+
if (res.matches(".*[Ã-ÿ].*")) {
718+
res = EntityUtils.toString(entity, StandardCharsets.UTF_8);
719+
}
719720
eof = true;
720721
return res;
721722
} catch (IOException e) {
@@ -764,4 +765,4 @@ public void cleanup() {
764765
resetErrorsAndConnParams();
765766
}
766767

767-
}
768+
}

0 commit comments

Comments
 (0)