Add a test for encoding detection