Fixed bug: provided charset not being used, always reverting to default