Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between Encoding and collation?

Tags:

mysql

encoding

I have seen certain questions and bugs related to encoding and collation. Could anyone of the visitors explain the difference in MySQL domain?

like image 747
Ghazanfar Mir Avatar asked Oct 11 '11 09:10

Ghazanfar Mir


People also ask

What is difference between character set and collation?

A character set is a set of symbols and encodings. A collation is a set of rules for comparing characters in a character set.

What does collation mean in MySQL?

A collation is a set of rules that defines how to compare and sort character strings. Each collation in MySQL belongs to a single character set. Every character set has at least one collation, and most have two or more collations. A collation orders characters based on weights.

What is the difference between charset and encoding?

Character Sets and Encoding Schemes The distinction between the two isn't always clear and the terms tend to be used interchangeable. A character set is a list of characters whereas an encoding scheme is how they are represented in binary. This is best seen with Unicode.

What is a character set collation?

A character set is a set of characters while a collation is the rules for comparing and sorting a particular character set. For example, a subset of a character set could consist of the letters A , B and C . A default collation could define these as appearing in an ascending order of A, B, C .


1 Answers

Encoding refers to that character set used.
Collation determines the sort order.

See: http://dev.mysql.com/doc/refman/5.5/en/charset-general.html

like image 190
Johan Avatar answered Oct 03 '22 01:10

Johan