<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.hoenzb
        {mso-style-name:hoenzb;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Hi Francois: Could your JSON escaping code implemented as a utility function in mapstring.c? I could see some use for it in other areas (e.g. templating).<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Steve<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> mapserver-dev-bounces@lists.osgeo.org [mailto:mapserver-dev-bounces@lists.osgeo.org]
<b>On Behalf Of </b>Francois Desjarlais<br>
<b>Sent:</b> Wednesday, August 28, 2013 9:00 AM<br>
<b>To:</b> Even Rouault<br>
<b>Cc:</b> mapserver-dev@lists.osgeo.org; Daniel Morissette<br>
<b>Subject:</b> Re: [mapserver-dev] RFC-93: UTFGrid output<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">Hi Even,<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Thanks for your feedback. <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">I'll be looking at these points and do the necessary changes.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">My code is already escaping non-valid characters in the JSON. It should always return a valid one.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Also, I don't have enough time to add the suggested mode before the end of the project and school restarting.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Regards<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Francois<o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><o:p> </o:p></p>
<div>
<p class="MsoNormal">2013/8/27 Even Rouault <<a href="mailto:even.rouault@mines-paris.org" target="_blank">even.rouault@mines-paris.org</a>><o:p></o:p></p>
<p class="MsoNormal">Le lundi 26 août 2013 13:06:18, Daniel Morissette a écrit :<o:p></o:p></p>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">> Hi Devs,<br>
><br>
> RFC-93 has been updated by François to reflect his implementation of<br>
> UTGGrid output in MapServer over the summer. Please have a look and<br>
> share your comments so that he has time to make any required changes<br>
> before the end of his project:<br>
><br>
>   <a href="http://mapserver.org/development/rfc/ms-rfc-93.html" target="_blank">
http://mapserver.org/development/rfc/ms-rfc-93.html</a><br>
><br>
> A sample app and docs are available at:<br>
><br>
>   <a href="http://msgsoc.mapgears.com/" target="_blank">http://msgsoc.mapgears.com/</a><br>
><br>
> And his code is in branch utfgridgsoc of his github fork:<br>
><br>
>   <a href="https://github.com/fdesj/mapserver/tree/utfgridgsoc" target="_blank">
https://github.com/fdesj/mapserver/tree/utfgridgsoc</a><o:p></o:p></p>
</div>
<p class="MsoNormal">Nice work.<br>
<br>
A few points and ideas :<br>
<br>
* <a href="http://msgsoc.mapgears.com/html/en/output/utfgrid.html" target="_blank">
http://msgsoc.mapgears.com/html/en/output/utfgrid.html</a> mentions "UTFGrids<br>
can be set on multiple layers but only one UTFGrid can be rendered at a time"<br>
but the RFC not. Perhaps this could be added in it too.<br>
<br>
* I'm wondering if the JSON escaping of values expanded in the "keys" (from<br>
UTFITEM)  and "data" (from UTFDATA) has been taken into account (in particular<br>
escaping of " and \ ). My quick review of the code seems to indicate no, but I<br>
might be wrong.<br>
<br>
* perhaps there could be a mode (for the lazy folks ;-) ) in which UTFDATA<br>
could be generated automatically from the "gml_include_items" and<br>
"gml_exclude_items" layer metadata ?<br>
<br>
* No validation of UTFRESOLUTION is done (line 310). If set to values < 1,<br>
this could lead to divizon by zero or failed mallocs due to negative values.<br>
Such values shoud likely be refused.<br>
<br>
* r->duplicates = strcmp("false", msGetOutputFormatOption(format,<br>
"DUPLICATES", "true")); at line 320 is a convoluted way of writing :<br>
<br>
 r->duplicates = EQUAL("true",  msGetOutputFormatOption(format, "DUPLICATES",<br>
"true"));<br>
<br>
or !EQUAL("false", ... )<br>
<br>
* MSVC will not be happy with wchar_t string[img->width/renderer-<br>
>utfresolution + 1]; at line 378<br>
<span style="color:#888888"><br>
<br>
<span class="hoenzb">Even</span><br>
<br>
<span class="hoenzb">--</span><br>
<span class="hoenzb">Geospatial professional services</span><br>
<span class="hoenzb"><a href="http://even.rouault.free.fr/services.html" target="_blank">http://even.rouault.free.fr/services.html</a></span></span><o:p></o:p></p>
<div>
<div>
<p class="MsoNormal">_______________________________________________<br>
mapserver-dev mailing list<br>
<a href="mailto:mapserver-dev@lists.osgeo.org">mapserver-dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/mapserver-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapserver-dev</a><o:p></o:p></p>
</div>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</body>
</html>