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 @@ -702,23 +702,16 @@ public String getString() {
702702 return "" ;
703703 try {
704704 this .setEntity ();
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- }
714- }
705+ Charset charset = ContentType .getOrDefault (entity ).getCharset ();
715706 String res = EntityUtils .toString (entity , charset );
707+ if (res .matches (".*[Ã-ÿ].*" )) {
708+ res = EntityUtils .toString (entity , StandardCharsets .UTF_8 );
709+ }
716710 eof = true ;
717711 return res ;
718712 } catch (IOException e ) {
719713 setExceptionsCatch (e );
720- } catch (IllegalArgumentException e ) {
721- }
714+ } catch (IllegalArgumentException e ) {}
722715 return "" ;
723716 }
724717
You can’t perform that action at this time.
0 commit comments