| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent f3d7e49 commit 2334335
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -68,6 +68,7 @@ static public boolean compile(JavaBuild build) throws SketchException { | |||
| 68 | 68 | //"-noExit", // not necessary for ecj | |
| 69 | 69 | "-source", "1.7", | |
| 70 | 70 | "-target", "1.7", | |
| 71 | + "-encoding", "utf8", | ||
| 71 | 72 | "-classpath", build.getClassPath(), | |
| 72 | 73 | "-nowarn", // we're not currently interested in warnings (works in ecj) | |
| 73 | 74 | "-d", build.getBinFolder().getAbsolutePath() // output the classes in the buildPath | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -24,6 +24,8 @@ | |||
| 24 | 24 | package processing.mode.java; | |
| 25 | 25 | ||
| 26 | 26 | import java.io.*; | |
| 27 | + import java.nio.charset.StandardCharsets; | ||
| 28 | + import java.nio.file.Files; | ||
| 27 | 29 | import java.util.ArrayList; | |
| 28 | 30 | import java.util.Enumeration; | |
| 29 | 31 | import java.util.HashMap; | |
@@ -249,14 +251,15 @@ public String preprocess(File srcFolder, | |||
| 249 | 251 | outputFolder.mkdirs(); | |
| 250 | 252 | // Base.openFolder(outputFolder); | |
| 251 | 253 | final File java = new File(outputFolder, sketch.getName() + ".java"); | |
| 252 | - final PrintWriter stream = new PrintWriter(new FileWriter(java)); | ||
| 254 | + BufferedWriter bw = Files.newBufferedWriter(java.toPath(), StandardCharsets.UTF_8); | ||
| 255 | + final PrintWriter stream = new PrintWriter(bw); | ||
| 253 | 256 | try { | |
| 254 | 257 | result = preprocessor.write(stream, bigCode.toString(), codeFolderPackages); | |
| 255 | 258 | } finally { | |
| 256 | 259 | stream.close(); | |
| 257 | 260 | } | |
| 258 | - } catch (FileNotFoundException fnfe) { | ||
| 259 | - fnfe.printStackTrace(); | ||
| 261 | + } catch (IOException e) { | ||
| 262 | + e.printStackTrace(); | ||
| 260 | 263 | String msg = "Build folder disappeared or could not be written"; | |
| 261 | 264 | throw new SketchException(msg); | |
| 262 | 265 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments