Let xml parser determine which encoding to use.

This commit is contained in:
Pavol Zibrita 2012-05-02 10:11:43 +02:00 committed by Victor Shcherb
parent 1749e60eee
commit fa7f1d4008

View file

@ -6,6 +6,7 @@ import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.text.NumberFormat;
@ -472,7 +473,7 @@ public class GPXUtilities {
format.setTimeZone(TimeZone.getTimeZone("UTC"));
try {
XmlPullParser parser = Xml.newPullParser();
parser.setInput(f, "UTF-8"); //$NON-NLS-1$
parser.setInput(new InputStreamReader(f)); //$NON-NLS-1$
Stack<GPXExtensions> parserState = new Stack<GPXExtensions>();
parserState.push(res);
int tok;
@ -484,7 +485,7 @@ public class GPXUtilities {
GPXExtensions parse = parserState.peek();
String tag = parser.getName();
if (!parse.parseEnd(tag,parserState)) {
log.error("Bad ending tag: " + tag + " for element " + parse.getClass());
log.debug("Bad ending tag: " + tag + " for element " + parse.getClass());
}
}
}