aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeandro Silva Ferreira <leandrosilvaferreira@gmail.com>2012-08-16 09:23:21 -0400
committerLeandro Silva Ferreira <leandrosilvaferreira@gmail.com>2012-08-16 09:23:21 -0400
commit996ae7a3f9d128d6ae85e602f9456af2144ebbae (patch)
treef36deedab08912f4c044e76e35b3c0548731a79c
parent33cc8f56d87556a2233c174a39247048bb2e33fd (diff)
downloadtraccar-server-996ae7a3f9d128d6ae85e602f9456af2144ebbae.tar.gz
traccar-server-996ae7a3f9d128d6ae85e602f9456af2144ebbae.tar.bz2
traccar-server-996ae7a3f9d128d6ae85e602f9456af2144ebbae.zip
Defined UTF-8 encoding.
-rw-r--r--src/org/traccar/geocode/GoogleReverseGeocoder.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/org/traccar/geocode/GoogleReverseGeocoder.java b/src/org/traccar/geocode/GoogleReverseGeocoder.java
index 724c60e50..a25f60d66 100644
--- a/src/org/traccar/geocode/GoogleReverseGeocoder.java
+++ b/src/org/traccar/geocode/GoogleReverseGeocoder.java
@@ -19,6 +19,8 @@ import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;
+import java.nio.charset.Charset;
+
import org.traccar.helper.Log;
/**
@@ -36,8 +38,10 @@ public class GoogleReverseGeocoder implements ReverseGeocoder {
try {
URL url = new URL("http://maps.googleapis.com/maps/api/geocode/json?latlng=" + latitude + "," + longitude + "&sensor=false");
URLConnection connection = url.openConnection();
- BufferedReader reader = new BufferedReader(
- new InputStreamReader(connection.getInputStream()));
+
+ connection.setRequestProperty("Content-Type", "application/json;charset=UTF-8");
+
+ BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream(),Charset.forName("UTF-8")));
// Find address line
String line;