Skip to content

Instantly share code, notes, and snippets.

@jruby
Created April 16, 2009 06:58
Show Gist options
  • Save jruby/96278 to your computer and use it in GitHub Desktop.
Save jruby/96278 to your computer and use it in GitHub Desktop.
diff --git a/bin/jruby b/bin/jruby
index 750f752..ef24cdd 100755
--- a/bin/jruby
+++ b/bin/jruby
@@ -207,6 +207,11 @@ do
shift
done
+# Force file.encoding to UTF-8 when on Mac, since Apple JDK defaults to MacRoman (JRUBY-3576)
+if [ `uname -s` = "Darwin" ]; then
+ java_args=("${java_args[@]}" "-Dfile.encoding=UTF-8")
+fi
+
# Add a property to report memory max
JAVA_OPTS="$JAVA_OPTS $JAVA_VM -Djruby.memory.max=${JAVA_MEM:4} -Djruby.stack.max=${JAVA_STACK:4}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment