1

I changed charset of database, tables and columns into UTF-8 :

ALTER DATABASE dbname CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE collection CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE collection MODIFY title VARCHAR(50) CHARACTER SET utf8 COLLATE utf8_general_ci;

And I inserted data into this table.

insert into collection (title) values ('Enfants et bébés');

Actually, data is inserted from a .sql file which is encoded in UTF-8 :

source collections.sql

The trouble is that the encoding fails :

select * from collection
+----+------------------------+
| id | title                  |
+----+------------------------+
| 17 | Enfants et Bébés     |
+----+------------------------+

I don't understand what's wrong. Thank you for your help

1 Answer 1

1

I found the solution. The trouble cames from mysql client which is not in UTF-8 :

SET NAMES utf8
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.