Escape unicode characters
Fixes #2905