Reputation: 896
If save two utf-8
and normal text(only English character) in text field
is there a difference between storage length in database(maybe convert not English character to English character)?
Example:
if i save ali
word in database, save as : ali
but if i save علی
word in database, save as : some code more than 3 char
Database: MySQL Engine : InnoDB
Upvotes: 1
Views: 169
Reputation: 7689
The idea of UTF-8
is that various Unicode characters are encoded using byte sequences of different lengths:
Tip: To save space with UTF-8, use VARCHAR
instead of CHAR
. Otherwise, MySQL must reserve three bytes for each character in a CHAR CHARACTER SET utf8 column
because that is the maximum possible length. For example, MySQL must reserve 30 bytes for a CHAR(10) CHARACTER SET utf8 column.
Upvotes: 2