Clean-up subtitle encoding detection code