File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
java/src/main/java/com/genexus/internet Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -725,14 +725,17 @@ public String getString() {
725
725
return "" ;
726
726
try {
727
727
this .setEntity ();
728
- Charset charset = ContentType .getOrDefault (entity ).getCharset ();
729
- if (charset == null ) {
728
+ ContentType contentType = ContentType .getOrDefault (entity );
729
+ Charset charset ;
730
+ if (contentType .equals (ContentType .DEFAULT_TEXT )) {
730
731
charset = StandardCharsets .UTF_8 ;
732
+ } else {
733
+ charset = contentType .getCharset ();
734
+ if (charset == null ) {
735
+ charset = StandardCharsets .UTF_8 ;
736
+ }
731
737
}
732
738
String res = EntityUtils .toString (entity , charset );
733
- if (res .matches (".*[Ã-ÿ].*" )) {
734
- res = EntityUtils .toString (entity , StandardCharsets .UTF_8 );
735
- }
736
739
eof = true ;
737
740
return res ;
738
741
} catch (IOException e ) {
You can’t perform that action at this time.
0 commit comments