Added support for optional character set