Data::...:Encode(3pm)

πŸ“¦
version 1.4.0 Β· 4 versions
, in debian trixie, ubuntu resolute, ubuntu stonking

πŸ’– 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::Encode depend to XS modules. So, yeah, that's the whole tea. πŸ™ˆ
  • Unicode::RecursiveDowngrade does 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