File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
java/src/main/java/com/genexus/internet Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -708,14 +708,15 @@ private void setEntityReader() throws IOException {
708708 }
709709
710710 public String getString () {
711- if (response == null ) return "" ;
711+ if (response == null )
712+ return "" ;
712713 try {
713714 this .setEntity ();
714- byte [] bytes = EntityUtils .toByteArray (entity );
715715 Charset charset = ContentType .getOrDefault (entity ).getCharset ();
716- String res = new String (bytes , charset );
717- if (res .matches (".*[Ã-ÿ].*" ))
718- res = new String (bytes , StandardCharsets .UTF_8 );
716+ String res = EntityUtils .toString (entity , charset );
717+ if (res .matches (".*[Ã-ÿ].*" )) {
718+ res = EntityUtils .toString (entity , StandardCharsets .UTF_8 );
719+ }
719720 eof = true ;
720721 return res ;
721722 } catch (IOException e ) {
@@ -764,4 +765,4 @@ public void cleanup() {
764765 resetErrorsAndConnParams ();
765766 }
766767
767- }
768+ }
You can’t perform that action at this time.
0 commit comments