What does COLLATE LOCALIZED ASC stand for?

Collate is just fancy speak for sort (well sort of). So this is sort ordering based on localized preferences (i.e. current language's alphabet and conventions) in ascending order.


It instructs SQLite to sort non-ASCII characters appropriately. Chars with diacritics (some call them accents) have higher byte codes than the character Z, so a plain ASCII sort wouldn't fit to many foreign languages.

For example, the capital A char's byte code is 0x41 and the capital Z char's is 0x5A. Then we have the Á (capital A accute) which code in Unicode is 0x00C1. So a plain byte code sort would result the Á to be after the Z.

But in languages that have this kind of characters the convention is to put those with diacritics as if they didn't have the diacritic. So the Á should be together with the plain A, at least before B.

And to illustrate, we have below a list of names sorted using their bytecode:

  • Brenda
  • Debby
  • George
  • Álvaro
  • Érico

Now using the COLLATE LOCALIZED it would sort by the "base" of the character:

  • Álvaro
  • Brenda
  • Debby
  • Érico
  • George