File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
java/src/processing/mode/java Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -68,6 +68,7 @@ static public boolean compile(JavaBuild build) throws SketchException {
6868 //"-noExit", // not necessary for ecj
6969 "-source" , "1.7" ,
7070 "-target" , "1.7" ,
71+ "-encoding" , "utf8" ,
7172 "-classpath" , build .getClassPath (),
7273 "-nowarn" , // we're not currently interested in warnings (works in ecj)
7374 "-d" , build .getBinFolder ().getAbsolutePath () // output the classes in the buildPath
Original file line number Diff line number Diff line change 2424package processing .mode .java ;
2525
2626import java .io .*;
27+ import java .nio .charset .StandardCharsets ;
28+ import java .nio .file .Files ;
2729import java .util .ArrayList ;
2830import java .util .Enumeration ;
2931import java .util .HashMap ;
@@ -249,14 +251,15 @@ public String preprocess(File srcFolder,
249251 outputFolder .mkdirs ();
250252// Base.openFolder(outputFolder);
251253 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 );
253256 try {
254257 result = preprocessor .write (stream , bigCode .toString (), codeFolderPackages );
255258 } finally {
256259 stream .close ();
257260 }
258- } catch (FileNotFoundException fnfe ) {
259- fnfe .printStackTrace ();
261+ } catch (IOException e ) {
262+ e .printStackTrace ();
260263 String msg = "Build folder disappeared or could not be written" ;
261264 throw new SketchException (msg );
262265
You can’t perform that action at this time.
0 commit comments