title: Different Charset in Android OS version
body: <p>I am writing an <code>AES code</code> for encryption and I realized different version of Android <code>encrypt</code> differently. I took sometime to Google and read something about <code>getBytes()</code> are subject to the charset in the system therefore the <code>encrypted</code> String is different.</p>
  
  <p>I log the info from <code>Log.i("Charset",Charset.defaultCharset().toString());</code></p>
  
  <p>On <strong>Android 2.3</strong> it says:</p>
  
  <pre><code>06-26 16:10:33.954: I/Charset(453): Charset[UTF-8]
  </code></pre>
  
  <p><strong>Android 2.2</strong> it says:</p>
  
  <pre><code>06-26 16:05:19.140: I/Charset(737): com.ibm.icu4jni.charset.CharsetICU[UTF-8]
  </code></pre>
  
  <p><strong>Android 4.x</strong> says:</p>
  
  <pre><code>06-26 15:53:17.770: I/Charset(16957): java.nio.charset.CharsetICU[UTF-8]
  </code></pre>
  
  <p>Android 2.3 and 4.x encrypt/decrypt the string with the same result but 2.2 is different.</p>
  
  <p>What can I do to <code>getBytes()</code> to make it consistent to all version?</p>