3

If I change the encoding of my database, tables and related columns from latin1_swedish_ci (default) to utf8_general_ci to show European and other characters, will that apply to any existing data, or only to new inserts?

I currently have names showing up as Rubén which don't fix themselves even when changing that column's encoding to utf8_general_ci.

Do I have to re-import my data into the database, or can I apply encoding changes to existing data 'in-place'?

4
  • How should the DB know that those characters are actually malformed in human's eyes? All it knows is that it's been told to store exactly those characters. So, yes, you'll basically need to convert them yourself. Commented Oct 27, 2011 at 18:18
  • This might help: mysqlperformanceblog.com/2007/12/18/… Commented Oct 27, 2011 at 18:19
  • Ok. I thought the data stored internally might be fine, but decoded improperly. Commented Oct 27, 2011 at 18:19
  • @Andre Please put that as an answer and I'll accept it. My issues are fixed. Thank you! Commented Oct 27, 2011 at 18:21

1 Answer 1

2

This might help:

UPDATE table SET column=CONVERT(CONVERT(column USING binary) USING utf8) WHERE id=123;

Source: http://www.mysqlperformanceblog.com/2007/12/18/fixing-column-encoding-mess-in-mysql/

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.