Ideally the character set should be set with the connection, and so this is exactly what's being done now. And now the character set code is attempted to be generalised.