What is the reasoning behind setting latin1_swedish_ci
as the compiled default when other options seem much more reasonable, like latin1_general_ci
or utf8_general_ci
?
2 Answers
The bloke who wrote it was co-head of a Swedish company.
Possibly for similar reasons, Microsoft SQL Server's default language us_english.
-
7He is Finnish , but Finnish and Swedish share almost the same special characters ,so they share the same case insensitive collation Feb 26, 2014 at 10:47
-
9Talking about 'good defaults'. Which this, of course, is not. Great to see that after what, 20 years? they changed this into a sane default, like
utf8_general_ci
. Good job, MySQL ! Sep 24, 2015 at 10:17 -
5Yes you are right, He named MariDB (Wife name is Maria) and MaxDB (His son name is Max). but why he left his Daughter name..! :) LOL. ! Jan 8, 2018 at 9:06
-
@AjmalPraveen Monty named his database projects in chronological order after his kids; My, Max and Maria. Feb 8, 2022 at 14:54
-
latin1_swedish_ci
is a single byte character set, unlike utf8_general_ci
.
Compared to latin1_general_ci
it has support for a variety of extra characters used in European languages. So it’s a best choice if you don’t know what language you will be using, if you are constrained to use only single byte character sets.
-
42I like this answer because it tries to objectively justify the choice of latin swedish. However, the accepted answer seems a more plausible explanation, from a social perspective, for why swedish was chosen in particular.– AlanJul 21, 2011 at 19:30
-
3It's certainly possible that this was the author's reasoning, and just a coincidence that he's Swedish. It seems reasonable that a Swede would want (and know) to support additional European characters.– MattJan 28, 2014 at 20:11
-
3-1 The accepted answer could be just an opinion but it is 100 times more reasonable than this answer. Also , you can see that "the bloke who wrote it" also named MariaDB after his daugther and maxDB after his son. Feb 26, 2014 at 10:35
-
2"latin1_general_ci it has support for a variety of extra characters used in European languages" - Just to make this clear, utf8_general_ci, unlike utf8_unicode, does have a wide support for European languages specific chars. I don't see an advantage over "latin1_swedish_ci". Or am I wrong?– MEMJul 1, 2015 at 11:52
-
For example, CHAR(2) latin1 uses 2 bytes, CHAR(2) utf8mb4 (which is full utf8) uses 8 bytes. I use latin1 to store 2-digit country codes because there will never be non-european characters– the_nutsJan 6, 2017 at 21:19
utf8_general_ci
does not support 4-byte UTF-8 so for true UTF-8 support you would wantutf8mb4_general_ci
or one of the othermb4
variants.