Mysql - exchange contents from ISO-8859-1 charset column to UTF-8

Asked

Viewed 37 times

1

It is possible to swap the content charset of specific columns?

I have a database with the following architecture: :: Idcontent (int autoincrement) :: Title (vchar) :: Summary (vchar) :: Content (Longtext)

In the form when you registered and/or changed the contents, the columns Title and Summary are with normal accent and the column Content, because it came from a wysiwyg editor configured in ISO-8859-1, is with the accent and special characters changed to this charset pattern.

That way, I wanted to see if:

  1. I need to do some routine in PHP that lists and updates via code for all columns to be in ISO-8859-1 or UTF-8 charset; or
  2. Is there any internal routine (Alter Table, etc) that performs this adjustment for me.

Thank you.

1 answer

1

ALTER TABLE table MODIFY column TEXT [...] CHARACTER SET utf8;

  • I will test and get back to you. This would work as opposed to utf-8 to iso-8859-1?

  • Does it work @Brennosardom

  • Existing data is converted?

Browser other questions tagged

You are not signed in. Login or sign up in order to post.