static string JsonEncode(string s) { if (s == null) s = ""; return s.Replace("\\", "\\\\").Replace("\"", "\\\""); }