title: Weird characters after processing a xml file in android
body: <p>I am making an andorid applicaiton which loads data from a xml file. The problem is that the xml file is not processed correctly and I am not able to serialize it, because of that. I think the problem is related to the encoding of the file.</p>
  
  <p>How I made the xml file? From Eclipse I have clicked on New-> File -> and created a blank xml, then I've filled it with the needed information.</p>
  
  <p>Here is how the xml looks in the editor:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;data&gt;
  &lt;categories&gt;
      &lt;category value="Inbox"/&gt;
      &lt;category value="Private"/&gt;
      &lt;category value="Work"/&gt;
      &lt;category value="Business"/&gt;
  &lt;/categories&gt;
  
  &lt;todos&gt;
      &lt;todo&gt;
          &lt;id&gt;1&lt;/id&gt;
          &lt;text&gt;Explore the app!&lt;/text&gt;
      &lt;/todo&gt;
  
      &lt;todo&gt;
          &lt;id&gt;2&lt;/id&gt;
          &lt;text&gt;Add more todos!&lt;/text&gt;
         &lt;date&gt;2013-05-09 12:21:55 CET&lt;/date&gt;
     &lt;/todo&gt;
  &lt;/todos&gt;
  &lt;/data&gt;
  </code></pre>
  
  <p>I am getting the xml file from res/xml and then I load the file in an Input Stream. After that I am converting the file to a String using the String constructor.</p>
  
  <p>Here is the java code:</p>
  
  <pre><code>    InputStream is = getResources().openRawResource(R.xml.startingdata);
      ByteArrayOutputStream bos = new ByteArrayOutputStream();
      int next = is.read();
      while (next &gt; -1) {
          bos.write(next);
          next = is.read();
      }
      bos.flush();
      byte[] result = bos.toByteArray();
      xmldata = new String(result,"UTF-8");
  </code></pre>
  
  <p>after this step, I show the new xmldata to a Toast, to check how it looks. However I receive part of the data, plus some weird characters. What I am doing wrong? Thank you in advance!
  I am attaching an image from my testing device, in order to show you the weird toast result:</p>
  
  <p><img src="https://i.stack.imgur.com/yuv9f.png" alt="enter image description here"></p>