Hi I’m passing path string to Groovy Script from Scala like below but when the string contains 2 bytes characters, the formatting will be garbled. How do you properly pass string to groovy script?
var gse = new GroovyScriptEngine()
var scriptClass = gse.loadScriptByName("script.groovy")
var i = scriptClass.newInstance().asInstanceOf[GroovyObject]
i.setProperty("DIR_HERE", new File(".").getAbsolutePath())
// when the path contains 2 bytes code like "c:/あああああ/bleh",
// the passed string will be garbled and will be like "c:/????????????/bleh"
If I write
script.groovyas:And then a new file
run.groovyas:Then when I run:
from the command line, it prints: