I18N::Collate(3perl)

πŸ’– I18N::Collate β€” the tea β˜•

okay bestie, gather round, we're looking at I18N::Collate, aka the vibe-checker for comparing 8-bit scalar data according to the current locale. yes that's the whole name section, we move fast here ✨


🌸 SYNOPSIS 🌸

use I18N::Collate;
setlocale(LC_COLLATE, 'locale-of-your-choice');
$s1 = I18N::Collate->new("scalar_data_1");
$s2 = I18N::Collate->new("scalar_data_2");

like, that's it. that's the whole situation. πŸ’…


🚨 DESCRIPTION 🚨

***

WARNING: starting from the Perl version 5.003_06
the I18N::Collate interface for comparing 8-bit scalar data
according to the current locale

      HAS BEEN DEPRECATED

That is, please do not use it anymore for any new applications
and please migrate the old applications away from it because its
functionality was integrated into the Perl core language in the
release 5.003_06.

See the perllocale manual page for further information.

***
bestie. DEPRECATED. not me having to tell you this but HAS BEEN DEPRECATED fr fr 😭 do NOT use this in anything new, and if you've got old code still riding with it, please migrate it away, because its functionality got folded into the Perl core itself in release 5.003_06. check out the perllocale manual page for the deets 🫢

so what did this module even do? it hands you objects that will collate according to your national character set β€” but only if the POSIX setlocale() function is supported on your system. no POSIX support, no party. πŸ™ˆ

you can compare $s1 and $s2 from up above with:

$s1 le $s2

and to extract the actual data itself you'll need a dereference, like so: $$s1 πŸ‘‘

this module uses POSIX::setlocale(). the basic collation conversion is done by strxfrm(), which terminates at NUL characters, being that it's a decent C routine. meanwhile collate_xfrm() handles embedded NUL characters gracefully β€” iconic behavior, honestly 🧚

🌈 which locales tho?? 🌈

the available locales depend on your operating system β€” every OS is doing its own thing, main character energy, cannot be managed. so try checking whether:

  • "locale -a" shows them, or
  • hit up the man pages for "locale" or "nlsinfo", or
  • go the direct approach:
    • "ls /usr/lib/nls/loc"
    • "ls /usr/lib/nls"
    • "ls /usr/lib/locale"
⚠️ heads up: not all the locales that your vendor supports are necessarily installed. so please consult your operating system's documentation, and possibly your local system administration (yes, you may have to talk to a human, sorry πŸ˜”).

the locale names are probably something like "xx_XX.(ISO)?8859-N" or "xx_XX.(ISO)?8859N" β€” for example, "fr_CH.ISO8859-1" is the Swiss (CH) variant of French (fr), ISO Latin (8859) 1 (-1), which is the Western European character set. she's specific, she's chic, she's giving locale naming convention πŸ’–


<div style="text-align:center">πŸ’œ ✨ πŸ¦‹ πŸŽ€ πŸ¦‹ ✨ πŸ’œ</div>

and that's the whole page, bestie! brought to you by perl v5.44.0, dated 2026-10-17, and like always β€” I18N::Collate(3perl). stay collated, don't use the deprecated thing, periodt. πŸ’…πŸŒΈ

πŸ“¦ where this page comes from
  • arch rolling: perl 5.44.0-1 Β· Artistic-1.0-Perl AND GPL-1.0-or-later
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms