Skip to content

mangled output when default character encoding is not UTF-8  #182

Description

@hansenmc

As reported https://stackoverflow.com/q/70925661/14419 the content of output files can get mangled when writing export files from a Windows machine, unless the default character set is explicitly set as UTF-8 -Dfile.encoding=UTF-8.

Upon investigation, it seems that we are relying on the default system encoding when AbstractTask method getValueAsBytes() invokes getBytes() without specifying the encoding:

return item.asString().getBytes();

It should instead be:

item.asString().getBytes(StandardCharsets.UTF_8);

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions