mirror of
https://github.com/processing/processing4.git
synced 2026-02-02 21:29:17 +01:00
Output java files in UTF-8 and force compiler to use UTF-8
This commit is contained in:
@@ -68,6 +68,7 @@ public class Compiler {
|
||||
//"-noExit", // not necessary for ecj
|
||||
"-source", "1.7",
|
||||
"-target", "1.7",
|
||||
"-encoding", "utf8",
|
||||
"-classpath", build.getClassPath(),
|
||||
"-nowarn", // we're not currently interested in warnings (works in ecj)
|
||||
"-d", build.getBinFolder().getAbsolutePath() // output the classes in the buildPath
|
||||
|
||||
@@ -24,6 +24,8 @@ Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
package processing.mode.java;
|
||||
|
||||
import java.io.*;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.Files;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Enumeration;
|
||||
import java.util.HashMap;
|
||||
@@ -249,14 +251,15 @@ public class JavaBuild {
|
||||
outputFolder.mkdirs();
|
||||
// Base.openFolder(outputFolder);
|
||||
final File java = new File(outputFolder, sketch.getName() + ".java");
|
||||
final PrintWriter stream = new PrintWriter(new FileWriter(java));
|
||||
BufferedWriter bw = Files.newBufferedWriter(java.toPath(), StandardCharsets.UTF_8);
|
||||
final PrintWriter stream = new PrintWriter(bw);
|
||||
try {
|
||||
result = preprocessor.write(stream, bigCode.toString(), codeFolderPackages);
|
||||
} finally {
|
||||
stream.close();
|
||||
}
|
||||
} catch (FileNotFoundException fnfe) {
|
||||
fnfe.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
String msg = "Build folder disappeared or could not be written";
|
||||
throw new SketchException(msg);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user