Allow for configurable connection encoding.

Hi there, 

these change allow for configuration of the connection encoding. 
Should come in handy with a growing number of input strings carrying along chars that require ut8mb4 encoding.

Cheers,
marionebl