============ Problem Description ============
Java IO stream copied sqlite3 database file, Chinese data query not come out, you have encountered this problem, help me answer
============ Solution 1============
Private void dbimport () { try { file dir = new file (Database_path); // if the/sdcard/testdb directory exists, create this directory if (!dir.exists ()) dir.mkdir (); // if not present in the/sdcard/testdb directory // test.db file, copy this file from the Asset\db directory to Catalogue of   // SD Cards (/SDCARD/TESTDB) if (!) ( New&nbSp File (DatabaseFilename2)). Exists ()) {// file f = (New file (databaseFilename2));// f.delete (); // get InputStream objects that encapsulate testdatabase.db files AssetManager asset = Getassets (); Inputstream is = asset.open ("db/database.db"); FileOutputStream fos = new FileOutputStream (databaseFilename2); byte[] buffer = new byte[1024]; int count = 0; // start copying testdatabase.db files while ((count = is.read (buffer)) > 0) { fos.write (Buffer, 0, count); } Fos.close (); Is.close (); // asset.close (); } } catch (Exception e) { e.printstacktrace (); } // deletedatabase ("testdatabase.db");//delete database }
This is the import db method that I originally wrote. Also useless to encoding. Japanese database, no problem.
============ Solution 2============
Reference:
http://download.csdn.net/detail/fire_fire_fire/5290315
Database replication issues in Android projects