add locale-guard when saving engine states, also #6418