Forum Discussion

Buschfunk's avatar
Buschfunk
Frequent Contributor
13 years ago

Groovy script does not write UTF-8

Hello,

I need to write UTF-8 encoded files from within a Groovy script. This looks as follows:

def f = new File("C:/temp/test.txt")
f.write("test", "UTF-8")

However the resulting file is in standard ANSI format. Opening it in a hex editor does not show the "magic bytes" 0xEFBBEF.

Regards,
Robert