Only call String.force_encoding when it exists