Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
2.5.6
-
None
-
None
-
Windows 10
Description
On Windows when running groovy from command line this code does not write proper UTF-8 character into the file:
def out=new PrintStream(new File('test.txt'), 'UTF-8') out.println sprintf('%s', '\u0439')"
while String.format() does it right:
def out=new PrintStream(new File('test.txt'), 'UTF-8') out.println String.format('%s', '\u0439')"
Now if I add JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF-8 before groovy command it works properly. But the problem is that sprintf() does not write to output stream so it should keep Unicode character properly encoded without -Dfile.encoding options.