Problem querydata with newline (\ and newline, tab ect)

Discussion created by Champion on Dec 29, 2011
Latest reply on Jan 9, 2012 by
I have a value in a field string example "Test /n Test1...".
If I publish a mapserver and I do a request rest query with response type json: it returns "Test //n Test1..." but from for newline in string I use /n. In rest esri uses QueryData because I have tried with this method and I have same response but if I use IRecordset I have no problem.

 IRecordSet pNewRs  = new RecordSet();
 IRecordSetInit prsInit = pNewRs as IRecordSetInit;

 IFields pFields = new Fields();
 IFieldsEdit pFieldsEdit = pFields as IFieldsEdit;
 pFieldsEdit.FieldCount_2 = 2;

 IField pField = new Field();
 IFieldEdit pFieldEdit = pField as IFieldEdit;
 pFieldEdit.Name_2 = "Type";
 pFieldEdit.Type_2 = esriFieldType.esriFieldTypeString;
 pFieldEdit.Length_2 = 50;

 pField = new Field();
 pFieldEdit = pField as IFieldEdit;

 pFieldEdit.Name_2 = "Area";
 pFieldEdit.Type_2 = esriFieldType.esriFieldTypeDouble;


 ICursor pIC = prsInit.Insert();
 IRowBuffer pRowBuf = prsInit.CreateRowBuffer();

 pRowBuf.set_Value(0, "Test /n Test1");
 pRowBuf.set_Value(1, 10.2);

 byte[] fs = Conversion.ToJson(pNewRs);
 using (System.IO.FileStream f = new System.IO.FileStream(@"c:\test.txt", System.IO.FileMode.Create))
  f.Write(fs, 0, fs.Length);

I have "Test \n Test1" in test.txt:
{"displayFieldName":"","fieldAliases":{"Type":"Type","Area":"Area"},"fields":[{"name":"Type","type":"esriFieldTypeString","alias":"Type","length":50},{"name":"Area","type":"esriFieldTypeDouble","alias":"Area"}],"features":[{"attributes":{"Type":"Test \n Test1","Area":10.2}}]}