2

I want to set a db column collation as Russian and Finnish. I found that there are either Russian or Finnish collations, but no simultaneous ones.

For Russian symbols ALTER TABLE Teams CHANGE Name CHARACTER SET cp1251 COLLATE cp1251_bin NOT NULL;

For Finnish symbols ALTER TABLE Teams CHANGE Name CHARACTER SET cp1251 COLLATE latin1_swedish_ci NOT NULL;

Is there any possibility to store both RU/FI symbols?

Slava Vedenin
  • 58,326
  • 13
  • 40
  • 59
Olya
  • 25
  • 1
  • 4
  • 1
    Correctly sorting a group of strings that are not of the same language *(and in this case, not even the same alphabet)* is not a trivial task, and databas collation will not help you. For **storing** data, use UTF-8. For **collating**, you need to figure out how to "intertwine" Finnish and Russian texts pseudo-alphabetically. – Anders Marzi Tornblad Apr 21 '16 at 12:25
  • Suggest `COLLATE utf8_unicode_ci` for collation. – Rick James Apr 22 '16 at 22:36

1 Answers1

5

Use UTF-8.

It's the modern and vastly superior choice, and covers all the characters you need (and more):

The idea of UTF-8 is that various Unicode characters are encoded using byte sequences of different lengths:

Basic Latin letters, digits, and punctuation signs use one byte.

Most European and Middle East script letters fit into a 2-byte sequence: extended Latin letters (with tilde, macron, acute, grave and other accents), Cyrillic, Greek, Armenian, Hebrew, Arabic, Syriac, and others.

If you are working in a PHP context, see this question for advice on how to implement UTF-8.

Community
  • 1
  • 1
Pekka
  • 442,112
  • 142
  • 972
  • 1,088