For some reason I don't know, I have some Kamailio tables with utf32_general_ci
collation (location in example) and others with latin1_swedish_ci
.
I try to find answer on github repos (https://github.com/kamailio/kamailio/blob/4.4/scripts/mysql/my_create.sql) but collation is not specified.
That's right? Does matters? Which one it's right choice?
My Kamailio version is 4.4.3.
What is Kamailio? What does it store in a database?
In general, all software today should be using full UTF-8
characterset encoding. In MySQL, the syntax is CHARACTER SET utf8mb4
.
You mentioned two COLLATIONs
; they have to do with sort order, not character encoding. The two mentioned correspond to character sets
utf32
-- 4 bytes per character quite wasteful of space; virtually no one uses it; there is no good reason (that I can think of) to use it today.latin1
-- 1 byte per character; handles western Europe, but none of Asia. It is an old default in MySQL (hence your tables having it).I do not know the ramifications of trying to change Kamailio.
One thing to note in how MySQL deals with character set differences: You must specify the encoding in the client when connecting to MySQL. Then, when INSERTing
and SELECTing
, MySQL will convert (if necessary, and if possible) between the client encoding and column encoding. Because of this automatic conversion, you will currently see nothing wrong for western European characters. But Greek, Chinese, etc will be mangled/lost when attempting to store into latin1
.