Only force encoding when necessary