Minor fix: on rewrite, the history file should not be re-encoded to utf8;