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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T15:42:34+00:00 2026-06-01T15:42:34+00:00

I call the Google geolocation service like this: $querystring = http://maps.googleapis.com/maps/api/geocode/json?sensor=false&latlng=.$row[‘lat’].,.$row[‘lng’]; $context = stream_context_create(array(

  • 0

I call the Google geolocation service like this:

        $querystring = "http://maps.googleapis.com/maps/api/geocode/json?sensor=false&latlng=".$row['lat'].",".$row['lng'];

        $context = stream_context_create(array(
            'http' => array(
                'timeout' => 10
            )
        ));

        $f = file_get_contents($querystring, 0, $context);
        $f = json_decode($f);

        if(!isset($f->status) || $f->status != 'OK') continue;

        $f = $f->results[0];
        $location = $f->formatted_address;

I then insert the location into the database:

        //add the location to the database
        $sql = "INSERT INTO `wp_postmeta`
            (`meta_id`, `post_id`, `meta_key`, `meta_value`)
            VALUES
            (
                NULL,
                '".intval($row['ID'])."',
                'location',
                '".mysql_real_escape_string($location)."'
            )";
        if($location)   $insert = mysql_query($sql);

The problem: Some characters are not well displayed when I edit the wordpress posts.
Like for example
“R. Hilário Riberio, 41-243 – Praça da Bandeira, Rio de Janeiro, 20270-180, Brazil”
should be
“R. Hilário Riberio, 41-243 – Praça da Bandeira, Rio de Janeiro, 20270-180, Brazil”

I use UTF-8 as character encoding on the website. But that’s irrelevant, because phpMyAdmin shows the data is entered into the database with the broken characters as well.

How do I set the right character encoding?

  • 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-01T15:42:35+00:00Added an answer on June 1, 2026 at 3:42 pm

    Use mysql_set_charset to set the database connection encoding to 'utf8', otherwise MySQL doesn’t know that you’re inserting UTF-8 encoded data. For more information, see Handling Unicode in a Web App.

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

Sidebar

Related Questions

I know about AJAX cross-domain policy. So I can't just call http://www.google.com over a
I'm trying to call data from the Google Calendar API with help from this
http://code.google.com/appengine/docs/python/tools/uploadingdata.html is not clearly understand. Where i should call the bulkloader.py or appcfg.py? Should
I'm using the navigator.geolocation.getCurrentPosition(function) api in firefox 3.6. When i try to call this
I'm using this jQuery AJAX call to google's ClientLogin. $.ajax({ url:https://www.google.com/accounts/ClientLogin, type:POST, data:{'Email': 'myusername',
Trying to write a simple call to google's JSON stock ticker API. I would
I have the following code which I call google #!/bin/bash q=$1 open http://www.google.com/search?q=$q It
I am trying to call google maps geocode and am following the example on
I want to call a google service using javascript with a keyword and a
I'm trying to make an external call to the google maps application on the

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.