mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-15 09:17:42 +00:00
Merge pull request #4834 from esaunders/4936-utf8-files-report
Use UTF8 encoding for report content.
This commit is contained in:
commit
77e35fd9f3
@ -24,6 +24,7 @@ import java.io.FileOutputStream;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.OutputStreamWriter;
|
import java.io.OutputStreamWriter;
|
||||||
import java.io.Writer;
|
import java.io.Writer;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -63,9 +64,12 @@ class FileReportText implements FileReportModule {
|
|||||||
public void startReport(String baseReportDir) {
|
public void startReport(String baseReportDir) {
|
||||||
this.reportPath = baseReportDir + FILE_NAME;
|
this.reportPath = baseReportDir + FILE_NAME;
|
||||||
try {
|
try {
|
||||||
out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(this.reportPath)));
|
out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(this.reportPath), StandardCharsets.UTF_8));
|
||||||
|
out.write('\ufeff');
|
||||||
} catch (FileNotFoundException ex) {
|
} catch (FileNotFoundException ex) {
|
||||||
logger.log(Level.WARNING, "Failed to create report text file", ex); //NON-NLS
|
logger.log(Level.WARNING, "Failed to create report text file", ex); //NON-NLS
|
||||||
|
} catch (IOException ex) {
|
||||||
|
logger.log(Level.WARNING, "Failed to write BOM to report text file", ex); //NON-NLS
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user