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 6134791
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:23:58+00:00 2026-05-23T17:23:58+00:00

So someone from Russia made a reverse geocoding response from my website. I parse

  • 0

So someone from Russia made a reverse geocoding response from my website. I parse the Json and concatenate city and state into one string on the client side. This is what that concatenated string ended up being:

???? ?????-?????????, ??????

Is there any situation where Google would send ? marks back through Json from a reverse geocoded response? The latitude/longtitude were correct. When I made the same Json post directly through my browser I got a correct response:

http://maps.googleapis.com/maps/api/geocode/json?latlng=60.0486851,30.3197483&sensor=true

Anyone have any ideas?

Could it be because I am accessing the Json from the USA, and he was accessing it from Russia?

EDIT: Concatenation happens here:

First I get the results:

geocoder.geocode({'latLng': realUsersLoc}, function(results, status) { 
    if (status == google.maps.GeocoderStatus.OK) { 
        if (results[1]) { 
            var loc = getCityState(results);

    function getCityState(results)
{
    var city = '';
    var state = '';
    var bad = '';
    var good = '';
    var us = true;
    // check for non-us
    for (var i = 0; i < results[0].address_components.length; i++)
    {
        var shortname = results[0].address_components[i].short_name;
        var longname = results[0].address_components[i].long_name;
        var type = results[0].address_components[i].types;
        if (type.indexOf("country") != -1)
        {
            if (!isNullOrWhitespace(shortname))
            {
                us = (shortname == 'US');
            }
            else
            {
                us = (longname == 'United States');
            }
        }
    }
    if (!us)
    {
        for (var i = 0; i < results[0].address_components.length; i++)
        {
            var shortname = results[0].address_components[i].short_name;
            var longname = results[0].address_components[i].long_name;
            var type = results[0].address_components[i].types;
            if (type.indexOf("country") != -1)
            {
                if (!isNullOrWhitespace(longname))
                {
                    state = longname;
                }
                else
                {
                    state = shortname;
                }
            }
            if (type.indexOf("administrative_area_level_1") != -1)
            {
                if (!isNullOrWhitespace(shortname))
                {
                    city = shortname;
                }
                else
                {
                    city = longname;
                }
            }
            else if (type.indexOf("locality") != -1)
            {
                if (!isNullOrWhitespace(shortname))
                {
                    city = shortname;
                }
                else
                {
                    city = longname;
                }
            }
        }
    }
    else
    {
        // us
        for (var i = 0; i < results[0].address_components.length; i++)
        {
            var shortname = results[0].address_components[i].short_name;
            var longname = results[0].address_components[i].long_name;
            var type = results[0].address_components[i].types;
            if (type.indexOf("administrative_area_level_1") != -1)
            {
                if (!isNullOrWhitespace(shortname))
                {
                    state = shortname;
                }
                else
                {
                    state = longname;
                }
            }
            else if (type.indexOf("locality") != -1)
            {
                if (!isNullOrWhitespace(shortname))
                {
                    city = shortname;
                }
                else
                {
                    city = longname;
                }
            }
            else if (type.indexOf("administrative_area_level_3") != -1)
            {
                if (!isNullOrWhitespace(shortname))
                {
                    good = shortname;
                }
                else
                {
                    good = longname;
                }
            }
            else if (type.indexOf("administrative_area_level_2") != -1)
            {
                if (!isNullOrWhitespace(shortname))
                {
                    bad = shortname;
                }
                else
                {
                    bad = longname;
                }
            }
        }
        if (city == '')
        {
            if (good != '')
            {
                city = good;
            }
            else
            {
                city = bad;
            }
        }
    }
    if (isNullOrWhitespace(city) && isNullOrWhitespace(state))
    {
        return 'N/A';
    }
    if (isNullOrWhitespace(city))
    {
        return state;
    }
    else if (isNullOrWhitespace(state))
    {
        return city;
    }
    return (city + ', ' + state)
}
  • 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-05-23T17:23:59+00:00Added an answer on May 23, 2026 at 5:23 pm

    Considering the presence of the dash with the question marks, it seems exceedingly likely that this is a character set issue and not a case of Google sending back question marks. (How certain are you that your site is specifying UTF-8 as its charset?) If you don’t care about internationalization, then you can work around the problem by forcing the results into English with the language parameter in the URL (see below). This is, of course, not ideal, but may be acceptable for some uses.

    In the likely event that the above workaround is not acceptable, try running your code with the results from http://maps.googleapis.com/maps/api/geocode/json?latlng=60.0486851,30.3197483&sensor=true&language=ru (note the language parameter tacked on to the end to force it to return Russian-language data) on various browsers to see if you can replicate the question-mark problem. (If you know what browser/platform the user was using when they experienced the problem, all the better.)

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

Sidebar

Related Questions

I'd like a response from someone who actually does real-time programming in C# or
I have a website where the public can upload JPEGs. Someone from the public
How do you prevent someone from entering the following into an EditText where setLines
Is there a way to prevent someone from faking a mime type on a
I heard from someone that the maximum array size in .NET is 4 GB?
I've heard from someone that they´re using a business process automation tool (like Weblogic
This situation arises from someone wanting to create their own pages in their web
I am reading a Makefile from someone else as follows. LDFLAGS=-lm -ljpeg -lpng ifeq
I need the advice from someone who knows Java very well and the memory
This is a noob question from someone who hasn't written a parser/lexer ever before.

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.