- Timestamp:
- 2010-01-04T17:40:03+13:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/common-src/src/jdbmedit/Jdb2Txt.java
r21395 r21403 30 30 31 31 import java.io.IOException; 32 import java.io.UnsupportedEncodingException; 33 import java.io.OutputStreamWriter; 34 import java.io.PrintWriter; 32 35 import java.util.Properties; 33 36 … … 40 43 HTree hashtable_; 41 44 45 static private PrintWriter utf8out = null; 46 47 static 48 { 49 try { 50 OutputStreamWriter osw = new OutputStreamWriter(System.out, "UTF-8"); 51 utf8out = new PrintWriter(osw, true); 52 } 53 catch (UnsupportedEncodingException e) { 54 System.out.println(e); 55 } 56 } 42 57 43 58 public Jdb2Txt(String db_filename) 44 59 throws IOException 45 60 { 61 if (db_filename.endsWith(".jdb")) { 62 // remove file extension as JDBM does not expect it 63 db_filename = db_filename.substring(0,db_filename.length()-4); 64 } 65 46 66 // create or open a record manager 47 67 Properties props = new Properties(); … … 71 91 while (key != null) { 72 92 val = (String) hashtable_.get(key); 73 System.out.println("[" + key + "]");74 System.out.println(val);93 utf8out.println("[" + key + "]"); 94 utf8out.println(val); 75 95 // 70 hypens 76 System.out.println("----------------------------------------------------------------------");96 utf8out.println("----------------------------------------------------------------------"); 77 97 key = (String) iter.next(); 78 98 }
Note:
See TracChangeset
for help on using the changeset viewer.