Path::...nicode(3pm)
π Path::Class::Unicode π
okay bestie, so this is a page from the User Contributed Perl Documentation section of the manual, and it's about Path::Class::Unicode, which maps Unicode filenames to your local encoding and code pages. it's giving "my filenames are pretty and I want them to STAY pretty" energy. π
β¨ NAME β¨
Path::Class::Unicode β maps Unicode filenames to local encoding and code pages π¦
πΈ SYNOPSIS πΈ
use Path::Class::Unicode;
# Use ufile() to create Unicode objects
my $fn = "\x{55ed}.txt";
my $file = ufile("path", $fn);
my $fh = $file->open;
my $fn = "\x{55ed}.txt";
my $file = ufile("/path", $fn);
my $uri = $file->uri; # file:///path/%E5%97%AD.txt (always utf-8)
my $fh = ufile_from_uri($uri)->open;
like, yes, that really is my $fn and my $file declared twice. that's how the original is written, and we are not touching it. no cap. π
π DESCRIPTION π
Path::Class::Unicode is a Path::Class extension, and its whole thing is handling Unicode file names by mapping them to local encodings when stringified. iykyk.
here's the tea on how it maps, depending on where you live:
- on all UNIX systems, including Mac OS X β it maps to UTF-8 β¨
- on Win32 systems β it uses the Windows code page (like
cp932for Japanese) π
it's very useful if you store file paths using URI representation like <file://> and use URI escaped UTF-8 characters for non-ASCII characters. slay. for all the deets, go look at Path::Class::URI.
π«Ά TODO π«Ά
not me reading the to-do list... it would be nice if we could proxy filehandles using Win32API::File. that's the whole todo, bestie. manifesting it. π
π AUTHOR π
- Tatsuhiko Miyagawa
<miyagawa@cpan.org> - mattn
two absolute icons, periodt. π
π LICENSE π
this library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. it's giving generous. it's giving open source royalty. π
π SEE ALSO π
nothing here, bestie β the section is empty. it's a vibe. lowkey iconic for that. β
and that's the whole page!! this was Path::...nicode(3pm) from perl v5.36.0, dated 2023-02-11, and it's part of the User Contributed Perl Documentation. mwah π
β¨ bye bestie, go stringify some filenames responsibly!!
π¦ where this page comes from
- debian trixie: libpath-class-uri-perl 0.08-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libpath-class-uri-perl 0.08-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libpath-class-uri-perl 0.08-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libpath-class-uri-perl 0.08-2 Β· Artistic-1.0-Perl OR 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