Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8045507
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T05:34:11+00:00 2026-06-05T05:34:11+00:00

I’m writing tests for my Grails-Application and I found a bug in my application

  • 0

I’m writing tests for my Grails-Application and I found a “bug” in my application – at least I think its my application.

My request looks like this:

http://maps.googleapis.com/maps/api/geocode/json?address=Karlsruhe+76131+Tullastraße+17&sensor=false

And the response contains my state / province (I don’t know the exact translation – I’m from Germany and it’s divided into 16 smaller “states” – called “Bundesland”)

My state is called “Baden-Württemberg” and thats in the response from the browser.

In my application I’m using an URL and a BufferedReader (with an InputStreamReader) to get the response.

I’m trying to assert, that the response from the browser is equal to the response I get from the URL-Connection in my code.

But – here comes the question/ problem – they differ. And the only difference I found was in the name of my state.

As mentioned before the response I got from the browser contains “Baden-Württemberg”, but the response I get through my code contains only “Baden-Wurttemberg” – the ü is switched with a regular u

Here’s my code:

URLConnection connection = new URL(url).openConnection()

BufferedReader br = new BufferedReader(new InputStreamReader(connection.content, "UTF-8" ))
StringBuffer connectionResponse = new StringBuffer()

while (br.ready()) {
    connectionResponse.append(br.readLine())
}
br.close()
return connectionResponse.toString()

My search led me to the option of passing a charset to the InputStreamReader – as I expect it’s UTF-8 I use this charset, but it’s not solving this bug.

Im just confused why this is possible.

Where should I look ? I’m not that experienced so I’m rather clueless

Edit:
I tested some more and if I search with a street containing an umlaut (“Bärenweg” or “Baerenweg” would be an example), both responses (code and browser) contain the correct value: Bärenweg. It seems only the state is affected by this.

Should I contact google right away? With this new test I’m not really sure if I can do something about it

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T05:34:13+00:00Added an answer on June 5, 2026 at 5:34 am

    The problem is solved.
    I asked a colleague of mine and he suggested, that the only reasonable cause could be different Request-Headers.

    The only way I could think of right away was to do it with wireshark. So i downloaded and installed it (WinPCab installed with it) and startet it after the installation.

    First I triggered both requests by pressing F5 in Firefox and running my tests in Grails

    Then I added the filter “http.response” (meaning all responses from HTTP request should be visible).
    The Response-Headers were almost equal and it didn’t occur any obvious mistake.

    Then I filtered for “http.request” to compare the headers sent to the google-api and there was a bit more off, then in the response.

    First I compared the Accept-Property and set the property in my code to the value from the Browser-Response (the one, which works fine).
    Didn’t solve the problem.

    So next property: Accept-Language.

    In the Request-header from the code this property wasn’t there at all, so I copied it from the Browser-Request-header and kazaam: it works!

    Accept-Language: de-de,de;q=0.8,en-us;q=0.5,en;q=0.3
    

    to set this property on the connection add the following code:

    connection.setRequestProperty("Accept-Language", "de-de,de;q=0.8,en-us;q=0.5,en;q=0.3");
    

    TL;DR / Long story short

    set the language-property in the request-header and google knows what language you expect the response to be in.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
For some reason, after submitting a string like this Jack’s Spindle from a text
I would like to run a str_replace or preg_replace which looks for certain words
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have some data like this: 1 2 3 4 5 9 2 6
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I would like to count the length of a string with PHP. The string
I have a jquery bug and I've been looking for hours now, I can't
this is what i have right now Drawing an RSS feed into the php,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.