set encoding and whitespace cleanup