save before changes on encoding