Created
January 27, 2013 05:57
-
-
Save kdmurthy/4646746 to your computer and use it in GitHub Desktop.
JRuby evalScript does not accept non-ascii characters. Is this the way it should be?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment