You might have to make explicit conversion maually something like:<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; string value = &quot;áÞÞÇÝÚÚÚììÉÉæäå&quot;; //I actually get this (in arabic) through user input<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; byte[] bytes = Encoding.Convert(Encoding.Unicode, Encoding.GetEncoding(1256), Encoding.Unicode.GetBytes(value));<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; StringBuilder s = new StringBuilder();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (int i = 0; i &lt; bytes.Length; i++)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; s.Append(Convert.ToChar(bytes[i]));<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; shpObj.text = s.ToString();<br><br>Best regards,<br>
<br>Tamas<br><br><br><br><div class="gmail_quote">2009/2/6 Murty Maganti <span dir="ltr">&lt;<a href="mailto:MMaganti@oriongis.com">MMaganti@oriongis.com</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">









<div link="blue" vlink="purple" lang="EN-US">

<div>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">HI </span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">&nbsp;</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">I am doing a simple thing. I have a map file and trying to show
some static text in Arabic on map. You can try this with any map file as it is nothing
to do with layers from map.</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">&nbsp;</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">At run time (like on a button click), please add this</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">&nbsp;</span></p>

<p style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(43, 145, 175);">layerObj</span>
lyr = <span style="color: blue;">new</span> <span style="color: rgb(43, 145, 175);">layerObj</span>(mapObj);</span></p>

<p style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="http://lyr.name" target="_blank">lyr.name</a> = <span style="color: rgb(163, 21, 21);">&quot;TextAcetate"</span>;</span></p>


<p style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lyr.status = <span style="color: rgb(43, 145, 175);">mapscript</span>.MS_ON;</span></p>

<p style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lyr.type = <span style="color: rgb(43, 145, 175);">MS_LAYER_TYPE</span>.MS_LAYER_ANNOTATION;</span></p>

<p style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lyr.labelcache = <span style="color: rgb(43, 145, 175);">mapscript</span>.MS_TRUE;</span></p>

<p style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&nbsp;</span></p>

<p style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: blue;">double</span>
locationX = 50;</span></p>

<p><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="color: blue;">double</span> locationY = 50;</span></p>

<p><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&nbsp;</span></p>

<p style="margin-left: 1in; text-indent: 0.5in;"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">lyr.transform = (<span style="color: blue;">int</span>)<span style="color: rgb(43, 145, 175);">mapscript</span>.MS_FALSE;</span></p>


<p style="margin-left: 1in; text-indent: 0.5in;"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&nbsp;</span></p>

<p style="margin-left: 1in; text-indent: 0.5in;"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(43, 145, 175);">classObj</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"> layerClass = <span style="color: blue;">new</span> <span style="color: rgb(43, 145, 175);">classObj</span>(lyr);</span></p>


<p style="margin-left: 1in; text-indent: 0.5in;"><span style="font-size: 11pt; color: rgb(31, 73, 125);">&nbsp;</span></p>

<p style="margin-left: 1in; text-indent: 0.5in;"><span style="font-size: 11pt; color: rgb(31, 73, 125);">//All
label properties</span></p>

<p style="margin-left: 1in; text-indent: 0.5in;"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">layerClass.label.size = 15;</span></p>

<p style="margin-left: 1in; text-indent: 0.5in;"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">layerClass.label.type =<span style="color: rgb(43, 145, 175);"> MS_FONT_TYPE</span>.MS_TRUETYPE;</span></p>


<p style="margin-left: 1in; text-indent: 0.5in;"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">…</span></p>

<p style="margin-left: 1in; text-indent: 0.5in;"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">…</span></p>

<p style="margin-left: 1in; text-indent: 0.5in;"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">layerClass.label.encoding = "CP1256";</span></p>

<p style="margin-left: 1in; text-indent: 0.5in;"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&nbsp;</span></p>

<p style="margin-left: 1in; text-indent: 0.5in;"><span style="font-size: 11pt; color: rgb(31, 73, 125);">&nbsp;</span></p>

<p style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(43, 145, 175);">shapeObj</span>
shpObj = <span style="color: blue;">new</span> <span style="color: rgb(43, 145, 175);">shapeObj</span>((<span style="color: blue;">int</span>)<span style="color: rgb(43, 145, 175);">MS_SHAPE_TYPE</span>.MS_SHAPE_POINT);</span></p>


<p style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(43, 145, 175);">lineObj</span>
lnObj = <span style="color: blue;">new</span> <span style="color: rgb(43, 145, 175);">lineObj</span>();</span></p>

<p style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&nbsp;</span></p>

<p style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(43, 145, 175);">pointObj</span>
pt = <span style="color: blue;">new</span> <span style="color: rgb(43, 145, 175);">pointObj</span>(locationX,
locationY, 0, 0);</span></p>

<p style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lnObj.add(pt);</span></p>

<p style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&nbsp;</span></p>

<p style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; shpObj.add(lnObj);</span></p>

<p style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&nbsp;</span></p>

<p style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; shpObj.text = "</span><span dir="rtl" style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="AR-AE">áÞÞÇÝÚÚÚììÉÉæäå</span><span dir="ltr"></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span dir="ltr"></span>"; //I actually get this (in arabic) through user input</span></p>


<p style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&nbsp;</span></p>

<p><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
lyr.addFeature(shpObj);</span></p>

<p><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&nbsp;</span></p>

<p><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">mapObj.draw();
//Onto a picture box or save as file</span></p>

<p><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&nbsp;</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">(In the map file, my output format is set to GD/PNG)</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">&nbsp;</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">Please let me know if you need more information.</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">&nbsp;</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">Thanks</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">Murty</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">&nbsp;</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">&nbsp;</span></p>

<div style="border-style: solid none none; border-color: rgb(181, 196, 223) -moz-use-text-color -moz-use-text-color; border-width: 1pt medium medium; padding: 3pt 0in 0in;">

<p><b><span style="font-size: 10pt;">From:</span></b><span style="font-size: 10pt;"> <a href="mailto:mapserver-users-bounces@lists.osgeo.org" target="_blank">mapserver-users-bounces@lists.osgeo.org</a>
[mailto:<a href="mailto:mapserver-users-bounces@lists.osgeo.org" target="_blank">mapserver-users-bounces@lists.osgeo.org</a>] <b>On Behalf Of </b>Tamas
Szekeres<br>
<b>Sent:</b> Friday, February 06, 2009 4:12 PM<div><div></div><div class="Wj3C7c"><br>
<b>To:</b> Murty Maganti<br>
<b>Cc:</b> <a href="mailto:mapserver-users@lists.osgeo.org" target="_blank">mapserver-users@lists.osgeo.org</a><br>
<b>Subject:</b> Re: [mapserver-users] Encoding issues</div></div></span></p>

</div><div><div></div><div class="Wj3C7c">

<p>&nbsp;</p>

<p style="margin-bottom: 12pt;">Please send me your example so
that I could examine what&#39;s going on.<br>
<br>
Best regards,<br>
<br>
Tamas<br>
<br>
<br>
</p>

<div>

<p>2009/2/6 Murty Maganti &lt;<a href="mailto:MMaganti@oriongis.com" target="_blank">MMaganti@oriongis.com</a>&gt;</p>

<div>

<div>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">Hi</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">&nbsp;</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">I tried with the suggested
encoding but still no success.</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">From the output below, I guess
ICONV support is included.</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">&nbsp;</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">E:\Utils\MapServer\Map Server
5.2 RC\ms4w\Apache\cgi-bin&gt;mapserv -v</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">MapServer version 5.2.0
OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP OUTPUT=PDF</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">&nbsp;OUTPUT=SWF OUTPUT=SVG
SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE <b>SUPPORTS=ICO</b></span></p>

<p><b><span style="font-size: 11pt; color: rgb(31, 73, 125);">NV</span></b><span style="font-size: 11pt; color: rgb(31, 73, 125);"> SUPPORTS=FRIBIDI SUPPORTS=WMS_SERVER
SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">SUPPORTS=WFS_CLIENT
SUPPORTS=WCS_SERVER SUPPORTS=SOS_SERVER SUPPORTS=FASTCGI SUP</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">PORTS=THREADS SUPPORTS=GEOS
SUPPORTS=RGBA_PNG INPUT=JPEG INPUT=POSTGIS INPUT=OGR</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">&nbsp;INPUT=GDAL INPUT=SHAPEFILE</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">&nbsp;</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">Where can get some details on
how to build the C# mapscript (Managed assembly only) from Visual Studio,
keeping all unmanaged dlls from binaries from ms4w. I just want to give a try
using MarshalAsAttribute.</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">&nbsp;</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">Thanks</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">Murty</span></p>

<div style="border-style: solid none none; border-color: -moz-use-text-color; border-width: 1pt medium medium; padding: 3pt 0in 0in;">

<p><b><span style="font-size: 10pt;">From:</span></b><span style="font-size: 10pt;"> Tamas Szekeres [mailto:<a href="mailto:szekerest@gmail.com" target="_blank">szekerest@gmail.com</a>] <br>
<b>Sent:</b> Friday, February 06, 2009 3:02 PM<br>
<b>To:</b> Murty Maganti<br>
<b>Cc:</b> <a href="mailto:mapserver-users@lists.osgeo.org" target="_blank">mapserver-users@lists.osgeo.org</a><br>
<b>Subject:</b> Re: [mapserver-users] Encoding issues</span></p>

</div>

<div>

<div>

<p>&nbsp;</p>

<p style="margin-bottom: 12pt;">Hi,<br>
<br>
You might want to try with encoding=&quot;ISO-8859-6&quot; assuming you have
libiconv compiled in.<br>
The c# mapscript doesn&#39;t specify explicit conversion during the marshaling. In
this case I assume an unicode to Charset.Ansi conversion will automatically
takes place by default.<br>
<br>
Best regards,<br>
<br>
Tamas<br>
<br>
<br>
<br>
</p>

<div>

<p>2009/2/6 Murty Maganti &lt;<a href="mailto:MMaganti@oriongis.com" target="_blank">MMaganti@oriongis.com</a>&gt;</p>

<div>

<div>

<p>Hello </p>

<p>&nbsp;</p>

<p>I am having some issues using Arabic text as labels. I am using C# map
script. I am setting the following at runtime</p>

<p>&nbsp;</p>

<p>labelObj label = classObj.label;</p>

<p>label.encoding = &quot;CP1256&quot;;</p>

<p>label.text = &quot;some text in Arabic&quot;; (At rune time in VS, I can see
the text is actually in Arabic)</p>

<p>&nbsp;</p>

<p>But labels are displayed as &#39;?????&#39;.</p>

<p>&nbsp;</p>

<p>&nbsp;Is there any conversion I need to do before setting the text value.
How are the string represented in the underlying mapscript dll (ASCII or
Unicode?). As I was reading in the MSDN, the default marshalling uses LPStr
which is a single byte of ASCII. Does it mean that first I need to convert from
Unicode to ASCII in C# before setting the value.</p>

<p>&nbsp;</p>

<p>Appreciate any help.</p>

<p>&nbsp;</p>

<p>Thanks</p>

<p>Murty</p>

<p>&nbsp;</p>

</div>

</div>

<p style="margin-bottom: 12pt;"><br>
_______________________________________________<br>
mapserver-users mailing list<br>
<a href="mailto:mapserver-users@lists.osgeo.org" target="_blank">mapserver-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/mapserver-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a></p>

</div>

<p>&nbsp;</p>

</div>

</div>

</div>

</div>

</div>

<p>&nbsp;</p>

</div></div></div>

</div>


</blockquote></div><br>