Multibyte character sanitize

#1141
I would fixed for support ree 1.8.7.