<br><br><div class="gmail_quote">2009/3/10 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);"> </span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">As per the code documentation in the method </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">msGetEncodedString (as shown
below</span><span style="font-size: 11pt; color: rgb(31, 73, 125);">), the characters are assumed to be UTF-8 by default.</span></p>

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

<p style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">char</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"> *msGetEncodedString(<span style="color: blue;">const</span>
<span style="color: blue;">char</span> *string, <span style="color: blue;">const</span>
<span style="color: blue;">char</span> *encoding)</span></p>

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

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

<p style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">  <span style="color: blue;">if</span> (len == 0 ||
(encoding &amp;&amp; strcasecmp(encoding, <span style="color: rgb(163, 21, 21);">&quot;UTF-8&quot;</span>)==0))</span></p>

<p><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">     
<span style="color: blue;">return</span> strdup(string);    <span style="color: green;">/* Nothing to do: string already in UTF-8 */</span></span></p>

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

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">Where as in the ‘values’ property of shapeObj.cs in C#, it is
using System.Runtime.InteropServices.Marshal.PtrToStringAnsi  (to marshal characters
from c to c#). Shoudn’t it be using System.Runtime.InteropServices.Marshal.PtrToStringUni
method since as the charcters are by default held in UTF-8 encoding?</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);"></span></p></div></div></blockquote><div><br>I don&#39;t think so. These 2 representations are quite different. UTF-8 use 8 bit representation with varying character length (1-4) , while unicode use 16 bit / character by default.<br>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">msGetEncodedString <span style="font-family: arial,helvetica,sans-serif;">is used to transform the labels during the drawing</span></span><span style="font-family: arial,helvetica,sans-serif;"> in ca</span>se if the encoding parameter is specified, but this function haven&#39;t been utilized when retieving the shape values.<br>
<br><br>Best regards,<br><br></div></div>Tamas<br>