Problem with character encoding.

  • 1
  • Problem
  • Updated 3 years ago
  • (Edited)

I have written code for Java to get data from WeatherUnderground API and everything worked fine for about 6 months, until few days ago.
Now I'm receiving data, that I can't decode.

For request:,17.024753.json
I'm getting (I have cut only the interesting part):
"full":"KawalerzystÃ3w, Wrocław, ",
"city":"KawalerzystÃ3w, Wrocław",
And this should be "Kawalerzystów, Wrocław, ". As you can see there is something wrong with polish letters.
"observation_time":"Last Updated on grudzień 3, 17:35 CET",
is correct.

I headers I have:
Content-Type: application/json; charset=UTF-8

For other request I have:
"observation_location": { "full":"Wały Jagiellońskie, Gdańsk, ",
"city":"Wały Jagiellońskie, Gdańsk",
should be: "Wały Jagiellońskie, Gdańsk.

What is interesting, that in field city in word "Jagiellońskie" and "Gdańsk" is the same letter that is field "observation_time" word "grudzień", but in field "observation_time" I'm reading it correct.

What should I do to decode WeatherUnderground API responses correctly?

Ryszard Trojnacki
Photo of Ryszard Trojnacki

Ryszard Trojnacki

  • 2 Posts
  • 0 Reply Likes

Posted 3 years ago

  • 1
Photo of Brendan Hayes

Brendan Hayes, Official Rep

  • 962 Posts
  • 124 Reply Likes
The fields you mentioned are filled in by the person setting up the station, and there's the chance the input was not formatted correctly and we are not escaping it correctly going out again.  We can look into it.
Photo of Ryszard Trojnacki

Ryszard Trojnacki

  • 2 Posts
  • 0 Reply Likes
OK thank you.

In addition, encoding was correct few weeks ago.
And now it is broken for all Polish cities with special polish characters (I couldn't found a city with polish letters that has correct encoding in observation location).

For example:
Query for location: 50.064650,19.944980, city: Kraków, URL:,19.944980.json
"observation_location": { "full":"KrakÃ3w, Krakow, ",
"city":"KrakÃ3w, Krakow",

Query for location: 52.732529,15.236930, city: Gorzów Wielkoposki, URL:,15.236930.json<br>"observation_location": { "full":"Gorzow Wlkp., GorzÃ3w Wielkopolski, LUBUSKIE",
"city":"Gorzow Wlkp., GorzÃ3w Wielkopolski",

Query for location: 50.349880,18.226184, city: Kędzierzyn-Koźle, URL:,18.226184.json
"observation_location": { "full":"Radio PARK 93,9 Fm, Kędzierzyn-KoÅole, OPOLSKIE",
"city":"Radio PARK 93,9 Fm, Kędzierzyn-KoÅole",

Query for location: 51.759248,19.455983, city: Łódź, URL:,19.455983.json<br>"observation_location": { "full":"Michała Drzymały, ŁÃ3dÅo, ",
"city":"Michała Drzymały, ŁÃ3dÅo",

Query for location: 52.406374,16.925168, city: Poznań, URL:,16.925168.json<br> "full":"Poznan, Jezyce ul. Norwida, Poznań, WIELKOPOLSKIE", "city":"Poznan, Jezyce ul. Norwida, Poznań",

And as previously "observation time" has correct polish letters, "wind_string" has correct polish letters: "wind_string":"From the południowy at 3.1 MPH Gusting to 6.9 MPH",
"wind_dir" has correct polish letters: "wind_dir":"południowy",
"weather" has correct polish letters: "weather":"przelotne opady śniegu",

Ryszard Trojnacki