Reapply  change for "Fixes #15969. Force escape of \uFFFE and \uFFFF in shrinksafe since they are non-characters per Unicode spec."