add charset detection