public

JRuby evalScript does not accept non-ascii characters. Is this the way it should be?

  • Download Gist
JRuby evalScriptLet vs. executeScript
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
package ruby.experiments;
 
import java.util.ArrayList;
 
import org.jruby.Ruby;
import org.jruby.javasupport.JavaEmbedUtils;
 
public class EvalScriptlet {
 
public static void main(String[] args) {
Ruby ruby = JavaEmbedUtils.initialize(new ArrayList<String>());
String script = "puts 'Hello World'";
ruby.executeScript(script, "<script>");
ruby.evalScriptlet(script);
String scriptUTF8 = "puts \"Árbol de demostración\"" ;
ruby.executeScript(scriptUTF8, "<script>");
ruby.evalScriptlet(scriptUTF8);
}
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.