utility functions to escape strings