<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Problem querydata with newline (\ and newline, tab ect) in ArcGIS REST APIs and Services Questions</title>
    <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/problem-querydata-with-newline-and-newline-tab-ect/m-p/674277#M3277</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Domenico,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In JSON backslash is escaped. Since the new line is represented as \n in the string the backslash is probably getting escaped with an additional \.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Ravi&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 05 Jan 2012 15:52:43 GMT</pubDate>
    <dc:creator>RaviNarayanan</dc:creator>
    <dc:date>2012-01-05T15:52:43Z</dc:date>
    <item>
      <title>Problem querydata with newline (\ and newline, tab ect)</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/problem-querydata-with-newline-and-newline-tab-ect/m-p/674274#M3274</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have a value in a field string example "Test /n Test1...".&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If I publish a mapserver and I do a request rest query with response type json: it returns "Test //n Test1..." but from json.org 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.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;

ESRI.ArcGIS.RuntimeManager.Bind(ESRI.ArcGIS.ProductCode.Desktop);
 IRecordSet pNewRs&amp;nbsp; = 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;
 pFieldsEdit.set_Field(0,pField);

 pField = new Field();
 pFieldEdit = pField as IFieldEdit;

 pFieldEdit.Name_2 = "Area";
 pFieldEdit.Type_2 = esriFieldType.esriFieldTypeDouble;
 pFieldsEdit.set_Field(1,pField);

 prsInit.CreateTable(pFields);

 ICursor pIC = prsInit.Insert();
 IRowBuffer pRowBuf = prsInit.CreateRowBuffer();

 
 pRowBuf.set_Value(0, "Test /n Test1");
 pRowBuf.set_Value(1, 10.2);
 pIC.InsertRow(pRowBuf);
 

 byte[] fs = Conversion.ToJson(pNewRs);
 using (System.IO.FileStream f = new System.IO.FileStream(@"c:\test.txt", System.IO.FileMode.Create))
 {
&amp;nbsp; f.Write(fs, 0, fs.Length);
&amp;nbsp; f.Flush();
&amp;nbsp; f.Close();
 }

&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; I have "Test \n Test1" in test.txt:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
{"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}}]}
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Dec 2011 13:49:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/problem-querydata-with-newline-and-newline-tab-ect/m-p/674274#M3274</guid>
      <dc:creator>nicogis</dc:creator>
      <dc:date>2011-12-29T13:49:52Z</dc:date>
    </item>
    <item>
      <title>Re: Problem querydata with newline (\ and newline, tab ect)</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/problem-querydata-with-newline-and-newline-tab-ect/m-p/674275#M3275</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The escape character in &lt;/SPAN&gt;&lt;A href="http://www.json.org/"&gt;json&lt;/A&gt;&lt;SPAN&gt; is backslash&amp;nbsp; (\). I see that you have specified the newline with a forward slash as /n. Does it work if a backslash is used?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In 10.0 I get the following response for a querying a string field that has a carriage return and a newline:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "attributes" : {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "FID" : 10,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "ID" : 12,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "TEXTFIELD" : "new line \r\n in text",&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "TEXT_ESC" : "new line \r\n in text"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jan 2012 15:48:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/problem-querydata-with-newline-and-newline-tab-ect/m-p/674275#M3275</guid>
      <dc:creator>RaviNarayanan</dc:creator>
      <dc:date>2012-01-03T15:48:32Z</dc:date>
    </item>
    <item>
      <title>Re: Problem querydata with newline (\ and newline, tab ect)</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/problem-querydata-with-newline-and-newline-tab-ect/m-p/674276#M3276</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you for replay.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Sorry I made a mistake in my writing: I meant that backslash. I have in field DENOM a string with this text: "Test \r\n Test1" but I have this result from this stardard query request (ags .net 10sp3 with data in file geodatabase): http: //myserver/ArcGIS/rest/services/myservice/MapServer/0/query?text=&amp;amp;geometry=&amp;amp;geometryType=esriGeometryPoint&amp;amp;inSR=&amp;amp;spatialRel=esriSpatialRelIntersects&amp;amp;relationParam=&amp;amp;objectIds=1&amp;amp;where=&amp;amp;time=&amp;amp;returnCountOnly=false&amp;amp;returnIdsOnly=false&amp;amp;returnGeometry=true&amp;amp;maxAllowableOffset=&amp;amp;outSR=&amp;amp;outFields=*&amp;amp;f=pjson&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;"features" : [&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "attributes" : {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "OBJECTID" : 1,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "IDEXT" : "01555",&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "DENOM" : "Test \\r\\n Test1",&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "INSEGNA" : " ",&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;.... &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What's the problem? I have tested also with querydata method in arcobjects and I have same problem. no problem with IRecordset arcobjects.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jan 2012 09:40:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/problem-querydata-with-newline-and-newline-tab-ect/m-p/674276#M3276</guid>
      <dc:creator>nicogis</dc:creator>
      <dc:date>2012-01-04T09:40:18Z</dc:date>
    </item>
    <item>
      <title>Re: Problem querydata with newline (\ and newline, tab ect)</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/problem-querydata-with-newline-and-newline-tab-ect/m-p/674277#M3277</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Domenico,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In JSON backslash is escaped. Since the new line is represented as \n in the string the backslash is probably getting escaped with an additional \.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Ravi&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jan 2012 15:52:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/problem-querydata-with-newline-and-newline-tab-ect/m-p/674277#M3277</guid>
      <dc:creator>RaviNarayanan</dc:creator>
      <dc:date>2012-01-05T15:52:43Z</dc:date>
    </item>
    <item>
      <title>Re: Problem querydata with newline (\ and newline, tab ect)</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/problem-querydata-with-newline-and-newline-tab-ect/m-p/674278#M3278</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I understand what you say, but:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- why did you say that it is escaped while in your previous reply in the visualization of your response it is not escaped?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;- why is it that, if I follow either Querydata method or IRecordset (see my previous example) I have two different results; the first one escaped while the second not escaped?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;- the specification are not followed&lt;/SPAN&gt;&lt;BR /&gt;&lt;IMG src="http://json.org/string.gif" /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you in advance for your help.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Jan 2012 16:22:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/problem-querydata-with-newline-and-newline-tab-ect/m-p/674278#M3278</guid>
      <dc:creator>nicogis</dc:creator>
      <dc:date>2012-01-06T16:22:31Z</dc:date>
    </item>
    <item>
      <title>Re: Problem querydata with newline (\ and newline, tab ect)</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/problem-querydata-with-newline-and-newline-tab-ect/m-p/674279#M3279</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Domenico,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The difference is , I had created the newline in the feature class by copy-pasting a new line from notepad++ into the field value. You are representing the newline by the escaped value \n.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is your question specific to REST API or ArcObjects?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Ravi&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Jan 2012 14:25:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/problem-querydata-with-newline-and-newline-tab-ect/m-p/674279#M3279</guid>
      <dc:creator>RaviNarayanan</dc:creator>
      <dc:date>2012-01-09T14:25:42Z</dc:date>
    </item>
    <item>
      <title>Re: Problem querydata with newline (\ and newline, tab ect)</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/problem-querydata-with-newline-and-newline-tab-ect/m-p/674280#M3280</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Ok, thank you. Copy and Paste a new line.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Jan 2012 19:16:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/problem-querydata-with-newline-and-newline-tab-ect/m-p/674280#M3280</guid>
      <dc:creator>nicogis</dc:creator>
      <dc:date>2012-01-09T19:16:17Z</dc:date>
    </item>
  </channel>
</rss>

