File tree Expand file tree Collapse file tree 1 file changed +5
-12
lines changed
java/src/main/java/com/genexus/internet Expand file tree Collapse file tree 1 file changed +5
-12
lines changed Original file line number Diff line number Diff line change @@ -724,23 +724,16 @@ public String getString() {
724724 return "" ;
725725 try {
726726 this .setEntity ();
727- ContentType contentType = ContentType .getOrDefault (entity );
728- Charset charset ;
729- if (contentType .equals (ContentType .DEFAULT_TEXT )) {
730- charset = StandardCharsets .UTF_8 ;
731- } else {
732- charset = contentType .getCharset ();
733- if (charset == null ) {
734- charset = StandardCharsets .UTF_8 ;
735- }
736- }
727+ Charset charset = ContentType .getOrDefault (entity ).getCharset ();
737728 String res = EntityUtils .toString (entity , charset );
729+ if (res .matches (".*[Ã-ÿ].*" )) {
730+ res = EntityUtils .toString (entity , StandardCharsets .UTF_8 );
731+ }
738732 eof = true ;
739733 return res ;
740734 } catch (IOException e ) {
741735 setExceptionsCatch (e );
742- } catch (IllegalArgumentException e ) {
743- }
736+ } catch (IllegalArgumentException e ) {}
744737 return "" ;
745738 }
746739
You can’t perform that action at this time.
0 commit comments