aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/WebDataHandler.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-12-07 09:43:43 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2015-12-07 09:43:43 +1300
commit979314a9cfe4215fcf453759153bea67be4a7dd7 (patch)
tree6d3f31ed60a88a2bcd61cab0c5e147a8812e3a2e /src/org/traccar/WebDataHandler.java
parenta20e996c0929bcca43e5b5595f7ec320fad3c213 (diff)
downloadtrackermap-server-979314a9cfe4215fcf453759153bea67be4a7dd7.tar.gz
trackermap-server-979314a9cfe4215fcf453759153bea67be4a7dd7.tar.bz2
trackermap-server-979314a9cfe4215fcf453759153bea67be4a7dd7.zip
Use UTF-8 name from standard library
Diffstat (limited to 'src/org/traccar/WebDataHandler.java')
-rw-r--r--src/org/traccar/WebDataHandler.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/org/traccar/WebDataHandler.java b/src/org/traccar/WebDataHandler.java
index f40d49a6d..688b4a840 100644
--- a/src/org/traccar/WebDataHandler.java
+++ b/src/org/traccar/WebDataHandler.java
@@ -17,6 +17,7 @@ package org.traccar;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
+import java.nio.charset.StandardCharsets;
import java.util.Calendar;
import java.util.Formatter;
import java.util.Locale;
@@ -111,7 +112,8 @@ public class WebDataHandler extends BaseDataHandler {
if (position.getAddress() != null) {
try {
- request = request.replace("{address}", URLEncoder.encode(position.getAddress(), "UTF-8"));
+ request = request.replace(
+ "{address}", URLEncoder.encode(position.getAddress(), StandardCharsets.UTF_8.name()));
} catch (UnsupportedEncodingException error) {
Log.warning(error);
}
@@ -119,7 +121,8 @@ public class WebDataHandler extends BaseDataHandler {
if (request.contains("{attributes}")) {
try {
- request = request.replace("{attributes}", URLEncoder.encode(attributes, "UTF-8"));
+ request = request.replace(
+ "{attributes}", URLEncoder.encode(attributes, StandardCharsets.UTF_8.name()));
} catch (UnsupportedEncodingException error) {
Log.warning(error);
}