File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
java/src/main/java/com/genexus/internet Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 44import java .net .InetAddress ;
55import java .net .URISyntaxException ;
66import java .net .UnknownHostException ;
7+ import java .nio .charset .Charset ;
78import java .nio .charset .StandardCharsets ;
89import java .security .KeyManagementException ;
910import java .security .KeyStoreException ;
2122import org .apache .http .client .config .CookieSpecs ;
2223import org .apache .http .conn .routing .HttpRoute ;
2324import org .apache .http .conn .ssl .NoopHostnameVerifier ;
25+ import org .apache .http .entity .ContentType ;
2426import org .apache .http .impl .conn .PoolingHttpClientConnectionManager ;
2527import org .apache .http .protocol .HttpContext ;
2628import org .apache .http .auth .AuthSchemeProvider ;
@@ -723,7 +725,11 @@ public String getString() {
723725 return "" ;
724726 try {
725727 this .setEntity ();
726- String res = EntityUtils .toString (entity , "UTF-8" );
728+ Charset charset = ContentType .getOrDefault (entity ).getCharset ();
729+ if (charset == null ) {
730+ charset = StandardCharsets .UTF_8 ;
731+ }
732+ String res = EntityUtils .toString (entity , charset );
727733 eof = true ;
728734 return res ;
729735 } catch (IOException e ) {
You can’t perform that action at this time.
0 commit comments