dawadiuttam / geocoder-java

Automatically exported from code.google.com/p/geocoder-java
0 stars 0 forks source link

Geocoder should use UTF-8 when reading results #17

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

1. add -Dfile.encoding=ISO-8859-1 to sample app

2. The results read from google are decode as ISO-8859-1 but are in UTF-8 format

Original issue reported on code.google.com by carsten....@gmail.com on 21 Mar 2012 at 1:21

GoogleCodeExporter commented 8 years ago
    private final static class GeoCoderReadUTF8 extends Geocoder {
        @Override
        protected GeocodeResponse request(Gson gson, String urlString)
                throws IOException {
            URL url = new URL(urlString);
            BufferedReader reader = new BufferedReader(new InputStreamReader(
                    url.openStream(), "UTF-8"));
            log.error("reading as UTF-8");
            try {
                return gson.fromJson(reader, GeocodeResponse.class);
            } finally {
                reader.close();
            }
        }
    }

Original comment by carsten....@gmail.com on 21 Mar 2012 at 1:37

GoogleCodeExporter commented 8 years ago

Original comment by panchmp on 28 Mar 2012 at 2:49

GoogleCodeExporter commented 8 years ago
please check with version 0.10

Original comment by panchmp on 28 Mar 2012 at 8:02

GoogleCodeExporter commented 8 years ago
<dependency>
  <groupId>com.google.code.geocoder-java</groupId>
  <artifactId>geocoder-java</artifactId>
  <version>0.10</version>
</dependency>

3/29/12 11:53:32 AM CEST: Missing artifact 
com.google.code.geocoder-java:geocoder-java:jar:0.10:compile

Original comment by carsten....@gmail.com on 29 Mar 2012 at 9:56

GoogleCodeExporter commented 8 years ago
as temporary solution please try 
<version>0.10-SNAPSHOT<version>

I will investigate later why version wasn't deployed to 
https://oss.sonatype.org/index.html#nexus-search;quick~geocoder-java

Original comment by panchmp on 29 Mar 2012 at 11:21

GoogleCodeExporter commented 8 years ago

Original comment by panchmp on 1 Sep 2012 at 10:40