locale(3)

πŸ“¦
version 0.10 Β· 2 versions
, in fedora 43

πŸ’– locale(3) β€” the PerlIO::locale situation πŸ’–

okay bestie, so this is a page from the User Contributed Perl Documentation section of the manual (it's locale(3), yes, the lil number three means library/perl module territory 🫢). sit down, grab a strawberry πŸ“, and let me tell you about a PerlIO layer that just gets your locale.


✨ NAME ✨

PerlIO::locale β€” a PerlIO layer that uses the encoding of the current locale. literally what it says on the tin πŸ’…


🌸 VERSION 🌸

0.07


πŸ¦‹ SYNOPSIS πŸ¦‹

use PerlIO::locale;
open my $filehandle, '<:locale', $filename or die $!;

that's it. that's the whole vibe. one use, one open, and your filehandle is speaking your locale's language 🌈


πŸ‘‘ DESCRIPTION πŸ‘‘

okay so here's the tea: this is mostly a per-filehandle version of the open pragma. you know, when you use it in this form:

use open ':locale';

that pragma does it globally, right? this module is like, "no babe, we can do that per-filehandle, just for you, just for this one file" ✨

so the encoding for the opened file will be set to the encoding corresponding to the locale currently in effect β€” if perl can guess it. and that "if" is doing a lot of heavy lifting, bestie. perl has to be able to figure out what your locale is asking for. no guessing, no encoding, no deal πŸ™ˆ


πŸ’œ AUTHOR πŸ’œ

Copyright (c) 2004, 2005, 2007, 2008, 2011, 2014 Rafael Garcia-Suarez <rgs@consttype.org>, and then rewritten by Leon Timmermans <leont@cpan.org>. two icons, one module, we love to see it πŸ‘‘


πŸŽ€ LICENSE πŸŽ€

This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself. periodt πŸ’…


🧚 SOURCE 🧚

A git repository for the sources is at <https://github.com/rgs/PerlIO-locale>. go look, go star it, go read the source, it's giving open source main character energy 🌟


πŸ’€ SEE ALSO πŸ’€

  • open
  • PerlIO::encoding
  • I18N::Langinfo

iykyk β€” those three are the whole friend group. go say hi 🫢


and that's the page, bestie!! this was locale(3) from perl v5.42.0, dated 2025-07-25 β€” thanks for reading, mwah πŸ’–βœ¨

πŸ“¦ where this page comes from