aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching/export
diff options
context:
space:
mode:
authorBananeweizen <bananeweizen@gmx.de>2013-08-11 11:34:30 +0200
committerBananeweizen <bananeweizen@gmx.de>2013-08-11 11:34:30 +0200
commit6696ce0e9a0cc07841af98c65909c0e549714c75 (patch)
treed30744fe4e4f1e2b1b5a6785d5e175d376b7c770 /main/src/cgeo/geocaching/export
parentd10d48660b64f772b5ad08949664f645ba7f9af2 (diff)
downloadcgeo-6696ce0e9a0cc07841af98c65909c0e549714c75.zip
cgeo-6696ce0e9a0cc07841af98c65909c0e549714c75.tar.gz
cgeo-6696ce0e9a0cc07841af98c65909c0e549714c75.tar.bz2
refactoring: findbugs cleanup
Diffstat (limited to 'main/src/cgeo/geocaching/export')
-rw-r--r--main/src/cgeo/geocaching/export/GpxExport.java9
-rw-r--r--main/src/cgeo/geocaching/export/GpxSerializer.java3
2 files changed, 8 insertions, 4 deletions
diff --git a/main/src/cgeo/geocaching/export/GpxExport.java b/main/src/cgeo/geocaching/export/GpxExport.java
index c31b1ae..4f5e063 100644
--- a/main/src/cgeo/geocaching/export/GpxExport.java
+++ b/main/src/cgeo/geocaching/export/GpxExport.java
@@ -9,6 +9,8 @@ import cgeo.geocaching.utils.AsyncTaskWithProgress;
import cgeo.geocaching.utils.FileUtils;
import cgeo.geocaching.utils.Log;
+import org.apache.commons.lang3.CharEncoding;
+
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
@@ -23,8 +25,9 @@ import android.widget.TextView;
import java.io.BufferedWriter;
import java.io.File;
-import java.io.FileWriter;
+import java.io.FileOutputStream;
import java.io.IOException;
+import java.io.OutputStreamWriter;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
@@ -130,11 +133,11 @@ class GpxExport extends AbstractExport {
final File exportLocation = new File(Settings.getGpxExportDir());
exportLocation.mkdirs();
- writer = new BufferedWriter(new FileWriter(exportFile));
+ writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(exportFile), CharEncoding.UTF_8));
new GpxSerializer().writeGPX(allGeocodes, writer, new GpxSerializer.ProgressListener() {
@Override
- public void publishProgress(int countExported) {
+ public void publishProgress(final int countExported) {
ExportTask.this.publishProgress(countExported);
}
});
diff --git a/main/src/cgeo/geocaching/export/GpxSerializer.java b/main/src/cgeo/geocaching/export/GpxSerializer.java
index 2d25296..1e39be4 100644
--- a/main/src/cgeo/geocaching/export/GpxSerializer.java
+++ b/main/src/cgeo/geocaching/export/GpxSerializer.java
@@ -11,6 +11,7 @@ import cgeo.geocaching.utils.TextUtils;
import cgeo.geocaching.utils.XmlUtils;
import cgeo.org.kxml2.io.KXmlSerializer;
+import org.apache.commons.lang3.CharEncoding;
import org.apache.commons.lang3.StringUtils;
import org.xmlpull.v1.XmlSerializer;
@@ -56,7 +57,7 @@ public final class GpxSerializer {
this.progressListener = progressListener;
gpx.setOutput(writer);
- gpx.startDocument("UTF-8", true);
+ gpx.startDocument(CharEncoding.UTF_8, true);
gpx.setPrefix("", PREFIX_GPX);
gpx.setPrefix("xsi", PREFIX_XSI);
gpx.setPrefix("groundspeak", PREFIX_GROUNDSPEAK);