summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sources/scalac/CompilerCommand.java6
-rw-r--r--sources/scalac/Global.java2
2 files changed, 8 insertions, 0 deletions
diff --git a/sources/scalac/CompilerCommand.java b/sources/scalac/CompilerCommand.java
index 12472e5d5b..548ee5d29a 100644
--- a/sources/scalac/CompilerCommand.java
+++ b/sources/scalac/CompilerCommand.java
@@ -55,6 +55,7 @@ public class CompilerCommand extends CommandParser {
public final StringOptionParser bootclasspath;
public final StringOptionParser extdirs;
public final StringOptionParser outpath;
+ public final StringOptionParser encoding;
public final StringOptionParser assemrefs;
public final ChoiceOptionParser target;
public final BooleanOptionParser noimports;
@@ -161,6 +162,11 @@ public class CompilerCommand extends CommandParser {
"d", "Specify where to place generated class files",
"directory", "."),
+ this.encoding = new StringOptionParser(this,
+ "encoding", "Specify character encoding used by source files",
+ // !!! is there a way to get the platform default charset name
+ "encoding", "ISO-8859-1"),
+
this.assemrefs = new StringOptionParser(this,
"r", "Assemblies referenced by the source program",
"assembly files", "."),
diff --git a/sources/scalac/Global.java b/sources/scalac/Global.java
index 718c5c919b..ece6ae14b5 100644
--- a/sources/scalac/Global.java
+++ b/sources/scalac/Global.java
@@ -59,6 +59,7 @@ public abstract class Global {
public final boolean printtokens;
public final String outpath;
+ public final String encoding;
public final String target;
/** the message reporter
@@ -193,6 +194,7 @@ public abstract class Global {
this.printtokens = args.print.tokens;
this.classPath = args.classpath();
this.outpath = args.outpath();
+ this.encoding = args.encoding.value;
this.target = interpret ? TARGET_INT : args.target.value.intern();
this.separate = args.separate.value.equals("yes") ||
args.separate.value.equals("default") && !this.target.equals(TARGET_INT);