Restoring encoding