title: android write sqlite file with arabic text
body: <p>I have a custom method to<br>
  copy the database from assets folder to the database directory<br></p>
  
  <pre><code>    AssetManager am = myContext.getAssets();
      OutputStream os = new FileOutputStream(DBFile);
      DBFile.createNewFile();
      byte []b = new byte[1024];
      int i, r;
      String []Files = am.list("");
      Arrays.sort(Files);
      for(i=1;i&lt;5;i++)        {
          String fn = String.format("0%d.database", i);
          if(Arrays.binarySearch(Files, fn) &lt; 0)
              break;
          InputStream is = am.open(fn);
          while((r = is.read(b)) != -1)
              os.write(b, 0, r);
          is.close();
      }
      os.close();
  </code></pre>
  
  <p>All works as expected and the database is copied to the apps database directory
  except for when I change the android system language (settings>language) and set
  the system language as arabic, and re install the app, it crashes and the database
  file isn't copied to the databases directory. It's just a blank file.</p>
  
  <p>Im thinking maybe i should read the database file with an encoding specified
  because something must change in java dhe moment I change the language.</p>