string quoting and escaping, with unit test