public DefaultNHttpClientConnection createConnection(final IOSession iosession) {
SSLIOSession ssliosession = createSSLIOSession(iosession, this.sslcontext, this.sslHandler);
CharsetDecoder chardecoder = null;
CharsetEncoder charencoder = null;
Charset charset = this.config.getCharset();
CodingErrorAction malformedInputAction = this.config.getMalformedInputAction() != null ?
this.config.getMalformedInputAction() : CodingErrorAction.REPORT;
CodingErrorAction unmappableInputAction = this.config.getUnmappableInputAction() != null ?
this.config.getUnmappableInputAction() : CodingErrorAction.REPORT;
if (charset != null) {
chardecoder = charset.newDecoder();
chardecoder.onMalformedInput(malformedInputAction);
chardecoder.onUnmappableCharacter(unmappableInputAction);