From: Damyan Ivanov Date: Mon, 28 Jan 2019 20:01:35 +0000 (+0200) Subject: replace two literal charset names with pre-defined constants X-Git-Tag: v0.4~3 X-Git-Url: https://git.ktnx.net/?a=commitdiff_plain;h=4cdedb2eecf4b8fa1570eff713db7c0d1b3095f7;p=mobile-ledger.git replace two literal charset names with pre-defined constants --- diff --git a/app/src/main/java/net/ktnx/mobileledger/async/RetrieveTransactionsTask.java b/app/src/main/java/net/ktnx/mobileledger/async/RetrieveTransactionsTask.java index 56a26621..f66da7a8 100644 --- a/app/src/main/java/net/ktnx/mobileledger/async/RetrieveTransactionsTask.java +++ b/app/src/main/java/net/ktnx/mobileledger/async/RetrieveTransactionsTask.java @@ -42,6 +42,7 @@ import java.lang.ref.WeakReference; import java.net.HttpURLConnection; import java.net.MalformedURLException; import java.net.URLDecoder; +import java.nio.charset.StandardCharsets; import java.text.ParseException; import java.util.ArrayList; import java.util.Date; @@ -131,8 +132,8 @@ public class RetrieveTransactionsTask ParserState state = ParserState.EXPECTING_ACCOUNT; String line; - BufferedReader buf = - new BufferedReader(new InputStreamReader(resp, "UTF-8")); + BufferedReader buf = new BufferedReader( + new InputStreamReader(resp, StandardCharsets.UTF_8)); int processedTransactionCount = 0; int transactionId = 0; diff --git a/app/src/main/java/net/ktnx/mobileledger/async/SaveTransactionTask.java b/app/src/main/java/net/ktnx/mobileledger/async/SaveTransactionTask.java index fae87bc3..f23cba32 100644 --- a/app/src/main/java/net/ktnx/mobileledger/async/SaveTransactionTask.java +++ b/app/src/main/java/net/ktnx/mobileledger/async/SaveTransactionTask.java @@ -33,6 +33,7 @@ import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.net.HttpURLConnection; +import java.nio.charset.StandardCharsets; import java.util.List; import java.util.Locale; import java.util.Map; @@ -82,7 +83,7 @@ public class SaveTransactionTask extends AsyncTask