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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T07:49:58+00:00 2026-06-05T07:49:58+00:00

Ok, so I’ve ensured that my MySQL (5.1.61) database is UTF8, the table is

  • 0

Ok, so I’ve ensured that my MySQL (5.1.61) database is UTF8, the table is UTF8, the field is UTF8, and the MySQL client’s charset is set to UTF8. I can store and retrieve UTF8 entries successfully. I’ve also ensured my terminal’s encoding is set to UTF8.

CREATE TABLE `cities` (
  `name` varchar(255) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

The issue when it comes to the 200,000 entries that already exist in the database. It appears the people we inherited the project from messed up a lot of the encoding, actually saving a string like Hörby as Hörby where à and ¶ are valid UTF8 characters. That is, MySQL is receiving a UTF8 string of Hörby and is storing it as such. Here is an example where the first entry is one of the old entries, and the second is us inserting “Hörby” into the database with everything set to UTF8:

mysql> INSERT INTO cities SET name = 'Hörby';
Query OK, 1 row affected (0.00 sec)

mysql> SELECT * FROM cities;
+----------+
| name     |
+----------+
| Hörby   | <--- old entry
| Hörby    | <--- new entry
+----------+

What can we do to convert the squished characters into what they once were? We’re pretty much ready to do anything at this point, but re-typing all 200,000 records is not feasible.

  • 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-05T07:50:00+00:00Added an answer on June 5, 2026 at 7:50 am

    It looks like you had previously stored utf8 encoded strings in a latin1 column, then converted that column to utf8. To fix that:

    1. Convert the data back to latin1:

      ALTER TABLE cities MODIFY name varchar(255) CHARACTER SET latin1;
      
    2. Change the column type to UTF-8 without altering the data (going via binary):

      ALTER TABLE cities MODIFY name varchar(255) CHARACTER SET binary;
      ALTER TABLE cities MODIFY name varchar(255) CHARACTER SET utf8;
      
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
I have this code to decode numeric html entities to the UTF8 equivalent character.
I am doing a simple coin flipping experiment for class that involves flipping a
Does anyone know how can I replace this 2 symbol below from the string

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.