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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T17:27:10+00:00 2026-05-22T17:27:10+00:00

I recently converted my database to UTF-8, which it should have been in the

  • 0

I recently converted my database to UTF-8, which it should have been in the first place. Everything looks fine, except when I use the function

echo mb_detect_encoding($_POST['province']);

I am getting ASCII for everything that doesn’t contain special characters, and I am getting UTF-8 for everything that does. However, these values are all being pulled from the database itself, so this is confusing to me. Is this how it is supposed to work?

Another thing that is not working is my foreign key constraint; I am unable to enter values from a dropdown list, which is again pulling the values from the database, so.

When I use

echo mb_detect_encoding($_POST['province']);
echo $_POST['province'];

I get

UTF-8
Galápagos

Which I cannot enter into the database under the reports table due to the foreign key restraint on the province table. However, the value coming directly from province table. I am losing my mind here.

However, I get

ASCII
Carchi

For another province in Ecuador, and this value goes right into the database. What am I doing wrong here?

  • 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-22T17:27:10+00:00Added an answer on May 22, 2026 at 5:27 pm

    This may be a case of needing client encoding set properly. Try this after the initial mysql connect:

    mysql_query("SET NAMES 'utf8'")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this very old access database which got converted to 2010 recently and
I have recently converted 10 JavaScript files into one file, which I then run
I have a report, which was recently converted from SSRS2005 to SSRS2208. The report
I recently converted a ruby library to a gem, which seemed to break the
I recently converted a multi-project Visual Studio solution to use .dlls instead of .libs
We have an existing (old) codeline that we have recently converted from VC6 to
Recently I have been investigating the possibilities of caching in ASP.NET. I rolled my
I recently converted an old MySQL database stored as latin1_swedish_ci to utf8_general_ci. I've now
I have recently upgraded to Visual Studio 2010. I have kept database projects separate
I have recently begun to use the EF v4 Code Only library for some

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.