diff options
Diffstat (limited to 'main/src/cgeo/geocaching/files/FileParser.java')
| -rw-r--r-- | main/src/cgeo/geocaching/files/FileParser.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/main/src/cgeo/geocaching/files/FileParser.java b/main/src/cgeo/geocaching/files/FileParser.java index 973e65f..9521c70 100644 --- a/main/src/cgeo/geocaching/files/FileParser.java +++ b/main/src/cgeo/geocaching/files/FileParser.java @@ -4,6 +4,7 @@ import cgeo.geocaching.Geocache; import cgeo.geocaching.utils.CancellableHandler; import org.apache.commons.io.IOUtils; +import org.apache.commons.lang3.CharEncoding; import org.eclipse.jdt.annotation.NonNull; import org.eclipse.jdt.annotation.Nullable; @@ -43,7 +44,7 @@ public abstract class FileParser { * @throws ParserException */ public Collection<Geocache> parse(final File file, final CancellableHandler progressHandler) throws IOException, ParserException { - BufferedInputStream stream = new BufferedInputStream(new FileInputStream(file)); + final BufferedInputStream stream = new BufferedInputStream(new FileInputStream(file)); try { return parse(stream, progressHandler); } finally { @@ -53,8 +54,8 @@ public abstract class FileParser { protected static StringBuilder readStream(@NonNull final InputStream is, @Nullable final CancellableHandler progressHandler) throws IOException { final StringBuilder buffer = new StringBuilder(); - ProgressInputStream progressInputStream = new ProgressInputStream(is); - final BufferedReader input = new BufferedReader(new InputStreamReader(progressInputStream, "UTF-8")); + final ProgressInputStream progressInputStream = new ProgressInputStream(is); + final BufferedReader input = new BufferedReader(new InputStreamReader(progressInputStream, CharEncoding.UTF_8)); try { String line; @@ -77,7 +78,7 @@ public abstract class FileParser { } } - protected static void fixCache(Geocache cache) { + protected static void fixCache(final Geocache cache) { if (cache.getInventory() != null) { cache.setInventoryItems(cache.getInventory().size()); } else { |
