fixed issue with encoding not overriding auto-detection