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 <[email protected]> wrote: > What bo zhang said or use dollar slashy string. > > Cheers, Paul. > > On Wed, Jun 14, 2017 at 7:37 PM, bo zhang <[email protected]> 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 <[email protected] >> > 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? >>> >>> >>> >> >
