make charset configurable via js

allow charset to be configurable via js config rather than forcing to utf8 via SET NAMES.