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 4
4
import java .net .InetAddress ;
5
5
import java .net .URISyntaxException ;
6
6
import java .net .UnknownHostException ;
7
+ import java .nio .charset .Charset ;
7
8
import java .nio .charset .StandardCharsets ;
8
9
import java .security .KeyManagementException ;
9
10
import java .security .KeyStoreException ;
21
22
import org .apache .http .client .config .CookieSpecs ;
22
23
import org .apache .http .conn .routing .HttpRoute ;
23
24
import org .apache .http .conn .ssl .NoopHostnameVerifier ;
25
+ import org .apache .http .entity .ContentType ;
24
26
import org .apache .http .impl .conn .PoolingHttpClientConnectionManager ;
25
27
import org .apache .http .protocol .HttpContext ;
26
28
import org .apache .http .auth .AuthSchemeProvider ;
@@ -723,7 +725,11 @@ public String getString() {
723
725
return "" ;
724
726
try {
725
727
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 );
727
733
eof = true ;
728
734
return res ;
729
735
} catch (IOException e ) {
You can’t perform that action at this time.
0 commit comments