Writing UTF-8 string to socket in Java
<p>At the moment I use</p>

<pre><code>serverOutput = new DataOutputStream(socketCliente.getOutputStream());
</code></pre>

<p>and then</p>

<pre><code>serverOutput.write(data.getBytes());
</code></pre>

<p>and it works fine UNTIL I add any non standard characters (for example ñ) and then as many characters I add, that number of characters are cut from the end of the file and don't arrive.</p>

<p>Full source code is available here in PandroidAgentTentacle.java</p>

<p><a href="http://pandora.svn.sourceforge.net/viewvc/pandora/trunk/pandora_agents/android/src/pandroid/agent/" rel="nofollow">http://pandora.svn.sourceforge.net/viewvc/pandora/trunk/pandora_agents/android/src/pandroid/agent/</a></p>
