only set encoding to latin1 when there is none