private string Encode(string text) { return (text ?? string.Empty).Replace("\"", "\\\\").Replace("\n", "\\n\"\n\""); }