sanitize strings before encoding them when using EAS