Add helper functions for escaping and unescaping UTF-8