groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Wolf <joew...@gmail.com>
Subject Re: Slashy strings in GroovyConsole
Date Wed, 14 Jun 2017 13:52:35 GMT
Also be careful when using slashy Strings with path names that start with a
lowercase "u"

They'll get interpreted as a unicode character escape, e.g. /c:\users/
--> TokenStreamIOException: Did not find four digit hex character code.

(BTW, I'm glad to see there are other GroovyConsole users on Windows out
there)

-Joe

On Wed, Jun 14, 2017 at 6:32 AM, Paul King <paulk@asert.com.au> wrote:

> What bo zhang said or use dollar slashy string.
>
> Cheers, Paul.
>
> On Wed, Jun 14, 2017 at 7:37 PM, bo zhang <zhangbodut@gmail.com> wrote:
>
>> def scriptDir = /C:\Folder1\My Documents\Folder2\Version\etc\//
>>
>> note the last slash. \/ is escaping /
>>
>> On Wed, Jun 14, 2017 at 4:44 PM, Dmytro Shyshchenko <shyschenko@gmail.com
>> > wrote:
>>
>>> Long time ago I was using slashy strings in my groovy scripts for the
>>> paths on Windows. Somehting like this:
>>> def scriptDir = /C:\Folder1\My Documents\Folder2\Version\etc\/
>>>
>>> However in the recent versions, like 2.3.6 or 2.4.11, I can no longer
>>> execute those scripts via a GroovyConsole. It always gave me an error
>>> pointing to the last charecter of the script. Like this:
>>> unexpected char: 0xFFFF at line: 19, column: 13
>>> which was a bit misleading...
>>>
>>> When I change the paths to a "normal" srtings, everything works fine, as
>>> it was before.
>>> def scriptDir = "C:\\Folder1\\My Documents\\Folder2\\Version\\etc\\"
>>>
>>> Is it a bug? Shall I report it?
>>>
>>>
>>>
>>
>

Mime
View raw message