Data::R...::Encode(3)

πŸ“¦ version 1.4.0, in alpine 3.24

πŸ’– NAME πŸ’–

XMLTV::Data::Recursive::Encode β€” the module that encodes/decodes, like, every value in a structure. All of them. At once. Slay.

(so this page is section 3 of the User Contributed Perl Documentation, catalogued as Data::R...::Encode(3) β€” the name got cut off by the terminal, she's shy, it happens πŸ’…)


✨ 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]);

okay so literally five lines and you're done, no cap 🫢


πŸ¦‹ 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. 🧚

So if you've ever sat there like "ugh I wish I could just bulk encode/decode the entire contents of a structure instead of crying node by node"… bestie, this module may help you. That's the whole vibe check. ⭐


🌸 METHODS 🌸

πŸ’œ decode

my $ret = XMLTV::Data::Recursive::Encode->decode($encoding, $data, [CHECK]);

Returns a structure containing nodes which are decoded from the specified encoding. Iconic behaviour honestly. ✨

πŸŽ€ encode

my $ret = XMLTV::Data::Recursive::Encode->encode($encoding, $data, [CHECK]);

Returns a structure containing nodes which are encoded to the specified encoding. Go off, king. πŸ‘‘

🌈 decode_utf8

my $ret = XMLTV::Data::Recursive::Encode->decode_utf8($data, [CHECK]);

Returns a structure containing nodes which have been processed through decode_utf8. she's literally just doing her job πŸ’…

πŸ“ encode_utf8

my $ret = XMLTV::Data::Recursive::Encode->encode_utf8($data);

Returns a structure containing nodes which have been processed through encode_utf8. (no CHECK here, don't come for me, that's just what the page says πŸ™ˆ)

πŸ’€ 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. the way that FROM_ENC becomes TO_ENC, we love a glow-up πŸ”₯


πŸ‘‘ AUTHOR πŸ‘‘

Tokuhiro Matsuno <tokuhirom AAJKLFJEF GMAIL COM> 🫢

gfx

(yes, both of them, credits where credits are due πŸ’–)


🧚 SEE ALSO 🧚

  • This module is inspired from Data::Visitor::Encode, but this module depended to too many modules. The author wanted to use this module in pure-perl, but Data::Visitor::Encode depend to XS modules. 😭 (that's the whole lore, fr fr)
  • 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. πŸŽ€


okay that's the whole page bestie, you're educated now, go encode something iconic πŸ’…βœ¨πŸŒΈ

sign-off: this lil beauty is perl v5.42.2, dated 2025-06-30, filed under Data::R...::Encode(3) πŸ¦‹ β€” mwah, love u, bye πŸ«ΆπŸ’–

πŸ“¦ where this page comes from