problem with encoding.utf8.getbytes in c#
<p>I am working on C#, trying below code</p>

<pre><code>byte[] buffer = new byte[str.Length];
buffer = Encoding.UTF8.GetBytes(str);
</code></pre>

<p>In str I've got lengthy data but I've got problem in getting complete encoded bytes.
Please tell me what's going wrong and how can I overcome this problem?</p>
