Skip to content

Instantly share code, notes, and snippets.

@mostlyobvious
Last active December 16, 2015 17:09
Show Gist options
  • Save mostlyobvious/5468105 to your computer and use it in GitHub Desktop.
Save mostlyobvious/5468105 to your computer and use it in GitHub Desktop.
>> require 'ffi-locale'
=> true
>> FFI
=> FFI
>> FFILocale::setlocale FFILocale::LC_COLLATE, 'pl_PL.UTF8'
=> nil
>> FFILocale::strcoll "łyk", "myk"
=> 88
>> "łyk" <=> "myk"
=> 1
>> %w(m l ł).sort { |a, b| FFILocale::strcoll a, b }
=> ["l", "m", "ł"]
locale
LANG="pl_PL.UTF-8"
LC_COLLATE="pl_PL.UTF-8"
LC_CTYPE="pl_PL.UTF-8"
LC_MESSAGES="pl_PL.UTF-8"
LC_MONETARY="pl_PL.UTF-8"
LC_NUMERIC="pl_PL.UTF-8"
LC_TIME="pl_PL.UTF-8"
LC_ALL=
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment