Changeset 309 for trunk/EventBenchConsole/src/de/ugoe
- Timestamp:
- 12/13/11 16:51:45 (13 years ago)
- Location:
- trunk/EventBenchConsole/src/de/ugoe/cs/eventbench
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/jfc/commands/CMDpreprocessJFC.java
r305 r309 2 2 3 3 import java.io.File; 4 import java.io.FileInputStream; 4 5 import java.io.FileNotFoundException; 5 import java.io.FileReader; 6 import java.io.FileWriter; 6 import java.io.FileOutputStream; 7 7 import java.io.IOException; 8 import java.io.InputStreamReader; 9 import java.io.OutputStreamWriter; 10 import java.io.UnsupportedEncodingException; 8 11 import java.security.InvalidParameterException; 9 12 import java.util.List; … … 42 45 43 46 File file = new File(source); 44 FileReader fileReader;47 InputStreamReader reader; 45 48 try { 46 fileReader = new FileReader(file); 49 FileInputStream fis = new FileInputStream(file); 50 reader = new InputStreamReader(fis, "UTF-16"); 47 51 } catch (FileNotFoundException e) { 52 Console.printerrln(e.getMessage()); 53 return; 54 } catch (UnsupportedEncodingException e) { 48 55 Console.printerrln(e.getMessage()); 49 56 return; … … 51 58 char[] buffer = new char[(int) file.length()]; 52 59 try { 53 fileReader.read(buffer);54 fileReader.close();60 reader.read(buffer); 61 reader.close(); 55 62 } catch (IOException e) { 56 63 Console.printerrln(e.getMessage()); … … 60 67 String content = new String(buffer).trim(); 61 68 62 FileWriter writer;69 OutputStreamWriter writer; 63 70 try { 64 writer = new FileWriter(target); 71 FileOutputStream fos = new FileOutputStream(target); 72 writer = new OutputStreamWriter(fos, "UTF-16"); 65 73 } catch (IOException e) { 66 74 Console.printerrln(e.getMessage()); … … 72 80 writer.write("</sessions>"); 73 81 } 82 writer.close(); 74 83 } catch (IOException e) { 75 84 Console.printerrln(e.getMessage()); -
trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/swt/CommandHistoryDialog.java
r287 r309 137 137 OutputStreamWriter writer = null; 138 138 try { 139 writer = new OutputStreamWriter(new FileOutputStream(file) );139 writer = new OutputStreamWriter(new FileOutputStream(file), "UTF-8"); 140 140 } catch (IOException e) { 141 141 Console.printerrln("Unable to open file for writing (read-only file):"
Note: See TracChangeset
for help on using the changeset viewer.