convert String to Unicode Byte array
<p>I'm trying to get the Unicode values of a String into a Byte array.</p>

<p>I started to use the following code that specifying Ascii. This gave a list of numbers as you would expect. </p>

<pre><code>byte[] bytes = null;
try {
    bytes = listOfApps.getBytes("US-ASCII");
}catch(Exception e){}
Log.e(TAG, "bytes = " + Arrays.toString(bytes));
</code></pre>



<pre><code>listOfAllApps = Gallery|Camera|Contacts|Phone|Email|Messages|Settings......

bytes = [71, 97, 108, 108, 101, 114, 121, 124, 67, 97, 109, 101, 114, 97......
</code></pre>

<p>.
So I changed my code to the following to specify unicode.</p>

<pre><code>byte[] bytes = null;
try {
    bytes = listOfApps.getBytes(Charset.forName("UTF-8"));
}catch(Exception e){}
Log.e(TAG, "bytes = " + Arrays.toString(bytes));
</code></pre>

<p>I still get the same output. I thought i would get an array of values that start with \u. Does anybody know what i'm doing wrong?</p>