File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed
java/src/main/java/com/genexus/internet Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -702,16 +702,23 @@ public String getString() {
702702 return "" ;
703703 try {
704704 this .setEntity ();
705- Charset charset = ContentType .getOrDefault (entity ).getCharset ();
706- String res = EntityUtils .toString (entity , charset );
707- if (res .matches (".*[Ã-ÿ].*" )) {
708- res = EntityUtils .toString (entity , StandardCharsets .UTF_8 );
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+ }
709714 }
715+ String res = EntityUtils .toString (entity , charset );
710716 eof = true ;
711717 return res ;
712718 } catch (IOException e ) {
713719 setExceptionsCatch (e );
714- } catch (IllegalArgumentException e ) {}
720+ } catch (IllegalArgumentException e ) {
721+ }
715722 return "" ;
716723 }
717724
You can’t perform that action at this time.
0 commit comments