below code can not run
def map = [name:"Test :: ( %2f %25 \$ * & ! @ # ^)"]
String s = map.inspect()
println Eval.me(s)
get error:
Script1.groovy: 1: illegal string body character after dollar sign;
solution: either escape a literal dollar sign "\$5" or bracket the value expression "${5}" @ line 1, column 30.
["name":"Test :: ( %2f %25 $ * & ! @ # ^)"]
but if string contain other special char like \”, it works correctly. any way, how to walk around? it’s emergency for me
(In response to follow up above)
OK, if you just want to exchange information, then you should use a Data Interchange Format, such as XML or JSON. I recommend JSON because it’s lightweight, fast, and really easy to use:
Computer 1
Computer 2
Please note that these require Groovy 1.8.0 or newer to function. There are plenty of examples for older versions of Groovy, and Grails has it’s own parsers built-in as well.