Always preserve original file encoding

Previously we only preserved the encoding when working in place. This
change preserves the encoding even when outputting to standard out.