what is the difference between utf8 and latin1?
UTF-8 is prepared for world domination, Latin1 isn't.
If you're trying to store non-Latin characters like Chinese, Japanese, Hebrew, Russian, etc using Latin1 encoding, then they will end up as mojibake. You may find the introductory text of this article useful (and even more if you know a bit Java).
Note that full 4-byte UTF-8 support was only introduced in MySQL 5.5. Before that version, it only goes up to 3 bytes per character, not 4 bytes per character. So, it supported only the BMP plane and not e.g. the Emoji plane. If you want full 4-byte UTF-8 support, upgrade MySQL to at least 5.5 or go for another RDBMS like PostgreSQL. In MySQL 5.5+ it's called utf8mb4
.
LINEAR B SYLLABLE B008 A
? : fileformat.info/info/unicode/char/10000/index.htm –
Francis VARBINARY
instead of VARCHAR
and decode/encode in the business tier yourself, but this is hacky. Consider asking a new question, maybe there are better ways. –
Sikora In latin1 each character is exactly one byte long. In utf8 a character can consist of more than one byte. Consequently utf8 has more characters than latin1 (and the characters they do have in common aren't necessarily represented by the same byte/bytesequence).
binary
collate...? and which one is better for english/numeric fields: ascii_general_ci
or ascii_bin
? –
Sisk © 2022 - 2024 — McMap. All rights reserved.