140

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

2 Answers 2

140

The bloke who wrote it was co-head of a Swedish company.

Possibly for similar reasons, Microsoft SQL Server's default language us_english.

7
  • 7
    He 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
  • 9
    Talking 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 !
    – Michahell
    Sep 24, 2015 at 10:17
  • 5
    Yes 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
  • @VexingParse Oh, I see.. Feb 10, 2022 at 0:59
108

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.

5
  • 42
    I 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.
    – Alan
    Jul 21, 2011 at 19:30
  • 3
    It'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.
    – Matt
    Jan 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?
    – MEM
    Jul 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_nuts
    Jan 6, 2017 at 21:19

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.