groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David M. Karr" <davidmichaelk...@gmail.com>
Subject Escaping unicode reference in slashy string
Date Mon, 08 Feb 2016 22:17:09 GMT
Someone was trying to point out difficulties with various string values 
in slashy strings.  I was able to refute most of his arguments, but he 
pointed out a curious issue involving unicode sequences.

If you have the following:
--------------
def var = /c:\uabc.txt/
---------------

This will fail to compile, as "\uabc." is not a valid unicode sequence.

So, the obvious thing to try is this:
------------------
def var = /c:\\uabc.txt/
------------------

That would fix it, right?  Well, sort of.  It doesn't get a compile 
error.  I expected it to produce "c:\uabc.txt", but instead it produced 
"c:\\uabc.txt".

What are relatively simple workarounds for this?

Mime
View raw message