forked from upstream-mirrors/OpenTracks
Write the VM's charset in the GPX file's XML header, rather than using a
hard-coded value. Per the Android docs, the default charset for Android is UTF-8.
This commit is contained in:
@@ -24,6 +24,7 @@ import android.location.Location;
|
|||||||
|
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.io.PrintWriter;
|
import java.io.PrintWriter;
|
||||||
|
import java.nio.charset.Charset;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.TimeZone;
|
import java.util.TimeZone;
|
||||||
@@ -58,8 +59,8 @@ public class GpxTrackWriter implements TrackFormatWriter {
|
|||||||
@Override
|
@Override
|
||||||
public void writeHeader() {
|
public void writeHeader() {
|
||||||
if (pw != null) {
|
if (pw != null) {
|
||||||
pw.println("<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ");
|
pw.format("<?xml version=\"1.0\" encoding=\"%s\" standalone=\"yes\"?>\n",
|
||||||
pw.println("standalone=\"yes\"?>");
|
Charset.defaultCharset().name());
|
||||||
pw.println("<?xml-stylesheet type=\"text/xsl\" href=\"details.xsl\"?>");
|
pw.println("<?xml-stylesheet type=\"text/xsl\" href=\"details.xsl\"?>");
|
||||||
pw.println("<gpx");
|
pw.println("<gpx");
|
||||||
pw.println(" version=\"1.0\"");
|
pw.println(" version=\"1.0\"");
|
||||||
|
|||||||
Reference in New Issue
Block a user