Comments on: MySQL’s character sets and collations demystified https://shlomi-noach.github.io/blog/mysql/mysqls-character-sets-and-collations-demystified Blog by Shlomi Noach Sun, 05 Aug 2012 04:41:09 +0000 hourly 1 https://wordpress.org/?v=5.3.3 By: shlomi https://shlomi-noach.github.io/blog/mysql/mysqls-character-sets-and-collations-demystified/comment-page-1#comment-112015 Sun, 05 Aug 2012 04:41:09 +0000 https://shlomi-noach.github.io/blog/?p=10#comment-112015 @unreal4u,

Very interesting indeed. I believe the LENGTH() function returns the size in bytes of the given string, not the size of the stored string. That is, it is independent of the underlying storage type.

]]>
By: Sobre COLLATION y CHARSET en MySQL « unreal4u's Personal Network https://shlomi-noach.github.io/blog/mysql/mysqls-character-sets-and-collations-demystified/comment-page-1#comment-112000 Sun, 05 Aug 2012 01:02:35 +0000 https://shlomi-noach.github.io/blog/?p=10#comment-112000 […] code.openark.org dev […]

]]>
By: unreal4u https://shlomi-noach.github.io/blog/mysql/mysqls-character-sets-and-collations-demystified/comment-page-1#comment-111995 Sun, 05 Aug 2012 00:42:10 +0000 https://shlomi-noach.github.io/blog/?p=10#comment-111995 @Milton: the different collations you mention incorporate or excludes different letters which alters the ordering process of a query. I don’t know about swedish, but one of the main differences between spanish_ci and spanish2_ci is that the latter includes the letters “CH” (between C and D) and “LL” (between L and M), which are not valid anymore in modern spanish. I’ve never used latin1_general_ci though, but I think it must include “CH” but not “LL” or something like that.

]]>
By: unreal4u https://shlomi-noach.github.io/blog/mysql/mysqls-character-sets-and-collations-demystified/comment-page-1#comment-111994 Sun, 05 Aug 2012 00:41:39 +0000 https://shlomi-noach.github.io/blog/?p=10#comment-111994 What you are saying about CHAR being allocated as 3 byte per character seems not entirely true in my tests, I executed the following:


CREATE TABLE a (
a CHAR(3) CHARSET utf8 COLLATE utf8_general_ci
) ENGINE=MyISAM;

INSERT INTO a VALUES ('abc'),('áéí'),('ábc');

SELECT LENGTH(a) AS byteLength, CHAR_LENGTH(a) AS charLength FROM a;

This will deliver the following result:

3 3
6 3
4 3

The BYTE size varies according to which type of characters are stored, so it seems that MySQL is capable of varying the size of the internal stored data, even if the column is defined as a fixed length field.

Am I correct or did I miss something?

Greetings.

]]>
By: Aneeq https://shlomi-noach.github.io/blog/mysql/mysqls-character-sets-and-collations-demystified/comment-page-1#comment-81830 Thu, 05 Apr 2012 07:47:53 +0000 https://shlomi-noach.github.io/blog/?p=10#comment-81830 The following link has an excellent explanation of how to enable Arabic, Urdu and other foreign language support in PHP/MySQL.

http://addr.pk/a44d

OR

http://phphelp.co/2012/03/30/how-to-make-php-and-mysql-support-arabic-urdu-and-charactersets-or-other-foreign-languages/

]]>
By: MySQL collations demystified :: Kelvin Tan - Lucene Solr Nutch Consultant https://shlomi-noach.github.io/blog/mysql/mysqls-character-sets-and-collations-demystified/comment-page-1#comment-14525 Mon, 07 Jun 2010 23:52:31 +0000 https://shlomi-noach.github.io/blog/?p=10#comment-14525 […] by Kelvin on 07 Jun 2010 at 06:52 pm | Tagged as: programming Good article here: https://shlomi-noach.github.io/blog/mysql/mysqls-character-sets-and-collations-demystified MySQL’s character sets and collations are often considered as a mystery, and many users either […]

]]>
By: Tali Luvhengo https://shlomi-noach.github.io/blog/mysql/mysqls-character-sets-and-collations-demystified/comment-page-1#comment-14456 Sat, 05 Jun 2010 10:24:27 +0000 https://shlomi-noach.github.io/blog/?p=10#comment-14456 Great post thanks.

]]>
By: shlomi https://shlomi-noach.github.io/blog/mysql/mysqls-character-sets-and-collations-demystified/comment-page-1#comment-12432 Wed, 21 Apr 2010 04:54:00 +0000 https://shlomi-noach.github.io/blog/?p=10#comment-12432 Hi,

Since I do not speak Spanish nor Swedish I can’t list the exact differences, if any.
Anyhow, it suggests the order of characters (dictionary-wise) in the latin1 alphabet. It is possible that two characters in latin1 will have different order in two different collations.
I believe the MySQL manual provides such example with German.

]]>
By: Milton https://shlomi-noach.github.io/blog/mysql/mysqls-character-sets-and-collations-demystified/comment-page-1#comment-12395 Tue, 20 Apr 2010 08:00:11 +0000 https://shlomi-noach.github.io/blog/?p=10#comment-12395 Hello Shlomi,
First of all sorry for my bad english.

About Collation: What is the deiference betwen latin1_general_ci, latin1_spanish_ci and latin1_swedish_ci??

Thanks in advance,

Milton

]]>
By: shlomi https://shlomi-noach.github.io/blog/mysql/mysqls-character-sets-and-collations-demystified/comment-page-1#comment-11597 Thu, 18 Mar 2010 06:19:29 +0000 https://shlomi-noach.github.io/blog/?p=10#comment-11597 @Vincent

There’s the utf8_bin collation

]]>