Buschfunk
13 years agoFrequent Contributor
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:
However the resulting file is in standard ANSI format. Opening it in a hex editor does not show the "magic bytes" 0xEFBBEF.
Regards,
Robert
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