Skip to content

Commit

Permalink
Encode using UTF-8 if return has funny characters
Browse files Browse the repository at this point in the history
Issue:201744

(cherry picked from commit e396e18)
  • Loading branch information
tomas-sexenian committed Oct 9, 2024
1 parent a8b011e commit 80d1134
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -714,6 +714,9 @@ public String getString() {
charset = StandardCharsets.UTF_8;
}
String res = EntityUtils.toString(entity, charset);
if (res.matches(".*[Ã-ÿ].*")) {
res = EntityUtils.toString(entity, StandardCharsets.UTF_8);
}
eof = true;
return res;
} catch (IOException e) {
Expand Down

0 comments on commit 80d1134

Please sign in to comment.