Project

General

Profile

Revision a163fed9

IDa163fed9749b791c1da514fb643168d7093cfb9c
Parent ab6f97de
Child fd411b34

Added by Andreas Müller 11 months ago

ref #1447 add utf8 to writer

View differences:

cdm-pesi/src/main/java/eu/etaxonomy/cdm/app/pesi/merging/PesiFindIdenticalNamesActivator.java
1 1
package eu.etaxonomy.cdm.app.pesi.merging;
2 2

  
3 3
import java.io.File;
4
import java.io.FileWriter;
4
import java.io.FileOutputStream;
5 5
import java.io.IOException;
6
import java.io.OutputStreamWriter;
7
import java.io.Writer;
6 8
import java.lang.reflect.InvocationTargetException;
7 9
import java.lang.reflect.Method;
10
import java.nio.charset.StandardCharsets;
8 11
import java.util.ArrayList;
9 12
import java.util.Arrays;
10 13
import java.util.HashMap;
......
156 159
        try{
157 160
            Method method = methodName == null? null : PesiMergeObject.class.getMethod(methodName);
158 161

  
159
            FileWriter writer = new FileWriter(sFileName);
162
//            FileWriter writer = new FileWriter(sFileName);
163
            Writer writer = new OutputStreamWriter(new FileOutputStream(new File(sFileName)), StandardCharsets.UTF_8);
160 164

  
161 165
            //create Header
162 166
            createHeader(writer, header);
......
197 201
        return false;
198 202
    }
199 203

  
200
	private void createHeader(FileWriter writer, String firstLine) throws IOException{
204
	private void createHeader(Writer writer, String firstLine) throws IOException{
201 205
		 	writer.append(firstLine);
202 206
		    writer.append('\n');
203 207

  
......
226 230
			writer.append('\n');
227 231
	}
228 232

  
229
	private void writeCsvLine(FileWriter writer, Map<UUID,PesiMergeObject> mergeObjects, Map<UUID,String> sources) throws IOException{
233
	private void writeCsvLine(Writer writer, Map<UUID,PesiMergeObject> mergeObjects, Map<UUID,String> sources) throws IOException{
230 234

  
231 235
        for (UUID uuid : sourceRefUuids){
232 236
	        PesiMergeObject merging = mergeObjects.get(uuid);

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)