Skip to content

Commit 5750a71

Browse files
tomas-sexenianBeta Bot
authored andcommitted
Cherry pick branch 'genexuslabs:FunnyFix' into beta
1 parent 75d644e commit 5750a71

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

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

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -702,23 +702,16 @@ public String getString() {
702702
return "";
703703
try {
704704
this.setEntity();
705-
ContentType contentType = ContentType.getOrDefault(entity);
706-
Charset charset;
707-
if (contentType.equals(ContentType.DEFAULT_TEXT)) {
708-
charset = StandardCharsets.UTF_8;
709-
} else {
710-
charset = contentType.getCharset();
711-
if (charset == null) {
712-
charset = StandardCharsets.UTF_8;
713-
}
714-
}
705+
Charset charset = ContentType.getOrDefault(entity).getCharset();
715706
String res = EntityUtils.toString(entity, charset);
707+
if (res.matches(".*[Ã-ÿ].*")) {
708+
res = EntityUtils.toString(entity, StandardCharsets.UTF_8);
709+
}
716710
eof = true;
717711
return res;
718712
} catch (IOException e) {
719713
setExceptionsCatch(e);
720-
} catch (IllegalArgumentException e) {
721-
}
714+
} catch (IllegalArgumentException e) {}
722715
return "";
723716
}
724717

0 commit comments

Comments
 (0)