Skip to content

Commit

Permalink
Improvement/velocity writer utf 8 encoding (#286)
Browse files Browse the repository at this point in the history
  • Loading branch information
duph97 authored Sep 5, 2024
1 parent b68154d commit 236db20
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStreamWriter;
import java.nio.charset.StandardCharsets;
import java.util.Map;
import java.util.Map.Entry;

Expand Down Expand Up @@ -91,7 +93,8 @@ public void writeReport(String templateSource, String target, Map<String, DataTa
// write output
File file = new File(target);
IOHelper.checkAndCreateLocation(file);
try (BufferedWriter writer = new BufferedWriter(new FileWriter(file))) {
try (BufferedWriter writer = new BufferedWriter(
new OutputStreamWriter(new FileOutputStream(file), StandardCharsets.UTF_8))) {
Velocity.evaluate(context, writer, "solicitor report velocity", templateString);
writer.flush();
} catch (IOException e) {
Expand Down
1 change: 1 addition & 0 deletions documentation/master-solicitor.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -1955,6 +1955,7 @@ Spring beans implementing this interface will be called at certain points in the
== Release Notes
Changes in 1.27.0::
* https://github.com/devonfw/solicitor/issues/283: New Reader for data generated by the Gradle License Report Plugin. See <<Gradle License Report Plugin>>. Reader `gradle2` deprecated (stage 2). Reader `gradle` removed.
* https://github.com/devonfw/solicitor/issues/285: VelocityWriter now enforces UTF-8 encoding when writing results.

Changes in 1.26.0::
* https://github.com/devonfw/solicitor/issues/281: Solicitor now assumes ScanCode v32 to be used within the ScanCode integration. ScanCode JSON result files of v30 and v31 can still be processed but the scripting for doing the scans assumes v32 to be installed.
Expand Down

0 comments on commit 236db20

Please sign in to comment.