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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T16:06:30+00:00 2026-05-21T16:06:30+00:00

I try to explain the whole problem with my poor english: I use to

  • 0

I try to explain the whole problem with my poor english:

I use to save data from my application (encoded on utf8) to database using the default connection of PHP (latin1) to the tables of my DB with latin1 as charset.

That wasn’t a big problem : for example the string Magnüs was stored as Magnüs, and when I recovered the data I saw correctly the string Magnüs (because the default connection, latin1).

Now, I change the connection, using the correct charset, with mysql_query("SET NAMES 'utf8'", $mydb), and I’ve also changed the charset of my tables’s fields, so the value now is correctly store as Magnüs on DB; Then I still seeing Magnüs when I retrieve the data and I print on my Web Application.

Of course, unfortunatly, some old values now are badly printed (Magnüs is printed as Magnüs).

What I’d like to do is “to convert” these old values with the real encoding.

ALTER TABLE <table_name> CONVERT TO CHARACTER SET utf8; will convert only the field type, not the data.

So, a solution (discovered on internet) should be this:

ALTER TABLE table CHANGE field field BLOB;
ALTER TABLE table CHANGE field field VARCHAR(255) CHARACTER SET utf8;

But these old string won’t change on database, so neither in the Web Application when I print them.

Why? And what can I do?

  • 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-21T16:06:31+00:00Added an answer on May 21, 2026 at 4:06 pm

    Make sure that your forms are sending UTF-8 encoded text, and that the text in your table is also UTF-8 encoded.

    According to the MySQL reference, the last two ALTER you mentioned do not change the column contents encoding, its more like a “reinterpretation” of the contents.

    Warning
    The CONVERT TO operation converts column values between the character sets. This is not what you want if you have a column in one character set (like latin1) but the stored values actually use some other, incompatible character set (like utf8). In this case, you have to do the following for each such column:

    ALTER TABLE t1 CHANGE c1 c1 BLOB;
    ALTER TABLE t1 CHANGE c1 c1 TEXT CHARACTER SET utf8;
    

    The reason this works is that there is no conversion when you convert to or from BLOB columns.

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

Sidebar

Related Questions

I'll try to explain my problem as clear as possible :). I am using
I'm having a mysqli data fetching problem. I will try to explain my problem
I try to explain my problem. I have a first view in which I
I'll try to explain shortly what I want to do: A project using a
I'll try to explain this with an example. I'm writing a chat application. There
I have this simple problem. I'll try to explain with a sample code An
OK, I'm going to try my best to explain my problem. I have this
I have a problem with a databinding in WPF. When I try to use
I will try to explain the problem that I have with this code. This
I'd better use the following sample codes to explain my problem: while True: NewThread

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.