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

  • Home
  • SEARCH
  • 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 6568503
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T14:29:11+00:00 2026-05-25T14:29:11+00:00

I have a database that stores data as UTF-8, but sometimes some data (outside

  • 0

I have a database that stores data as UTF-8, but sometimes some data (outside of my control) is added with unrecognized characters which are stored as question marks (?). Is there any way to configure MySQL to remove those characters instead?

  • 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-25T14:29:12+00:00Added an answer on May 25, 2026 at 2:29 pm

    maybe solving the problem instead of working around it will be the better solution. if you just remove the question marks, the stored data wouldn’t be so ugly as it#s now, but it will still be wrong (wrong = not exactly the data the user wanted to save).

    this problem sounds like you’ve missed to specify a character encoding somewhere, so that the client’s default settings are used (you havn’t said wich exactly are the clients – maybe the users browser?) wich seems to be utf-8 or something compatible most times – but sometimes there’s a clint with an exotic default charset wich makes you run into problems.

    to solve this, simply make sure you’ve set character encoding to utf-8 everywere:

    • tell MySQL to use utf-8. to do this, add this to your my.cnf:

      collation_server = utf8_unicode_ci
      character_set_server = utf8
      
    • before interacting with mysql, send this two querys:

      SET NAMES 'utf8';
      CHARSET 'utf8';
      

      or, alternatively, let php do this afteropening the connection:

      mysql_set_charset('utf8', $conn);
      
    • set UTF-8 as the default charset for your database

      CREATE DATABASE `my_db` DEFAULT CHARACTER SET 'utf8';
      
    • do the same for tables:

      CREATE TABLE `my_table` (
        -- ...
      ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
      
    • assuming the client is a browser, serve your content as utf-8 and the the correct header:

      header('Content-type: text/html; charset=utf-8');
      

      to be really sure the browser understands, add a meta-tag:

      <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
      
    • and, last but not least, tell the browser to submit forms using utf-8

      <form accept-charset="utf-8" ...>
      
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an iOS app that stores some data in a sqlite database. The
I have a sql database that stores some documents. A user can sign into
I have a SQL Server 2005 database that stores data for multiple users. Each
I have a database table (called Info) that stores [Data], [fkID], [UserID], [Timestamp]. [Data]
We have a database on our master server (PHP/MySQL) that stores our data thats
Say I have a database that stores table data by year using an identical
I have an application that stores data in an Oracle database. I want to
I have a database that stores a user's access token (along with some other
I have a simple two-field form that stores its data in the database. For
I have a database that stores dates broken into int's. I.e. Day, Month and

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.