Added unit test for charset detection