Converts multi-line strings into quoted strings, escaping characters if necessary.