Data::...:Encode(3pm)
π NAME π
XMLTV::Data::Recursive::Encode β ok so basically the manual page is filed under Data::...:Encode(3pm), but the actual star of the show is this module, and what it does is Encode/Decode Values In A Structure. Yes bestie, we're encoding recursively. Every node. All of it. π
β¨ SYNOPSIS β¨
use XMLTV::Data::Recursive::Encode;
XMLTV::Data::Recursive::Encode->decode('euc-jp', $data);
XMLTV::Data::Recursive::Encode->encode('euc-jp', $data);
XMLTV::Data::Recursive::Encode->decode_utf8($data);
XMLTV::Data::Recursive::Encode->encode_utf8($data);
XMLTV::Data::Recursive::Encode->from_to($data, $from_enc, $to_enc[, $check]);
Look at that. Five whole ways to vibe-check your data structure's encoding. π«Ά
πΈ DESCRIPTION πΈ
XMLTV::Data::Recursive::Encode visits each node of a structure, and returns a new structure with each node's encoding (or similar action) applied. It does not mutate your original, it hands you a fresh little baby structure. π
So if you've ever been sitting there like "omg I wish I could do a bulk encode/decode of the contents of a structure" β then bestie, this module may help you. That's literally what it's for. No cap. π₯
π METHODS π
decode
my $ret = XMLTV::Data::Recursive::Encode->decode($encoding, $data, [CHECK]);
Returns a structure containing nodes which are decoded from the specified encoding. Give it the encoding, give it the data, optionally give it CHECK, and it gives you back a whole new structure. β¨
encode
my $ret = XMLTV::Data::Recursive::Encode->encode($encoding, $data, [CHECK]);
Returns a structure containing nodes which are encoded to the specified encoding. Same energy as decode, opposite direction, iconic behaviour honestly. π
decode_utf8
my $ret = XMLTV::Data::Recursive::Encode->decode_utf8($data, [CHECK]);
Returns a structure containing nodes which have been processed through decode_utf8. Note: no $encoding argument here, because utf8 is just... the vibe. π¦
encode_utf8
my $ret = XMLTV::Data::Recursive::Encode->encode_utf8($data);
Returns a structure containing nodes which have been processed through encode_utf8. And notice, bestie β no CHECK argument on this one. It just goes. β
from_to
my $ret = XMLTV::Data::Recursive::Encode->from_to($data, FROM_ENC, TO_ENC[, CHECK]);
Returns a structure containing nodes which have been processed through from_to. You give it where it's from, you give it where it's going, and optionally a CHECK to keep it honest. A whole glow-up for your data. π
π AUTHOR π
Tokuhiro Matsuno <tokuhirom AAJKLFJEF GMAIL COM>
and also gfx π«Ά
π SEE ALSO π
- This module is inspired from
Data::Visitor::Encode, but this module depended to too much modules. π - The author wanted to use this module in pure-perl, but
Data::Visitor::Encodedepend to XS modules. So, yeah, that's the whole tea. π Unicode::RecursiveDowngradedoes not supports perl5's Unicode way correctly. π
π LICENSE π
Copyright (C) 2010 Tokuhiro Matsuno All rights reserved.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. Periodt. β¨
and that's the whole page bestie!! this little masterpiece was served up by perl v5.40.1, dated 2025-04-19, under the manual page name Data::...:Encode(3pm) β go forth and recursively encode, you absolute main character ππ¦π
π¦ where this page comes from
- debian trixie: libxmltv-perl 1.4.0-1 Β· GPL-2.0-only
- ubuntu resolute: libxmltv-perl 1.4.0-1 Β· GPL-2.0-only
- ubuntu stonking: libxmltv-perl 1.4.0-1 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms