Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
<dependency>
<groupId>org.apache.pdfbox</groupId>
<artifactId>pdfbox</artifactId>
<version>2.0.27</version>
<version>3.0.3</version>
</dependency>
<dependency>
<groupId>org.jsoup</groupId>
Expand Down
17 changes: 5 additions & 12 deletions java/src/main/java/com/genexus/internet/HttpClientJavaLib.java
Original file line number Diff line number Diff line change
Expand Up @@ -718,23 +718,16 @@ public String getString() {
return "";
try {
this.setEntity();
ContentType contentType = ContentType.getOrDefault(entity);
Charset charset;
if (contentType.equals(ContentType.DEFAULT_TEXT)) {
charset = StandardCharsets.UTF_8;
} else {
charset = contentType.getCharset();
if (charset == null) {
charset = StandardCharsets.UTF_8;
}
}
Charset charset = ContentType.getOrDefault(entity).getCharset();
String res = EntityUtils.toString(entity, charset);
if (res.matches(".*[Ã-ÿ].*")) {
res = EntityUtils.toString(entity, StandardCharsets.UTF_8);
}
eof = true;
return res;
} catch (IOException e) {
setExceptionsCatch(e);
} catch (IllegalArgumentException e) {
}
} catch (IllegalArgumentException e) {}
return "";
}

Expand Down
Loading
Loading