function utf8_collate_key(str: String, len: Number(gssize)): String {
    // Gjs wrapper for g_utf8_collate_key()

Converts a string into a collation key that can be compared with other collation keys produced by the same function using strcmp().

The results of comparing the collation keys of two strings with strcmp() will always be the same as comparing the two original keys with GLib.utf8_collate.

Note that this function depends on the [current locale][setlocale].


a UTF-8 encoded string.


length of str, in bytes, or -1 if str is nul-terminated.


a newly allocated string. This string should be freed with when you are done with it.