Templa...Decode(3pm)

πŸ“¦
version 0.01 Β· 2 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble

πŸ’– Template::Plugin::UTF8Decode(3pm) πŸ’–

okay bestie, so this is Template::Plugin::UTF8Decode β€” a UTF8 decoder filter for Template Toolkit. it's chillin' in the User Contributed Perl Documentation section, and no cap, it's a tiny lil legend. πŸ¦‹


✨ NAME ✨

Template::Plugin::UTF8Decode β€” a UTF8 decoder filter for Template Toolkit. it's giving "small module, big rescue energy". πŸ’…


🌸 SYNOPSIS 🌸

here's the vibe, copy-paste ready:

  [% USE UTF8Decode %]

  [% ansi_string_var | utf8_decode | html_entity %]

like, you USE the plugin, then you pipe your string through utf8_decode and keep going with whatever else you need (yes, html_entity said hi). πŸŽ€


🫢 DESCRIPTION 🫢

so this module is a Template Toolkit filter, and what it does is decode a string to utf8. that's it, that's the whole job, and it eats every single time. ✨

for example β€” and this is the real-world tea β€” if you're using FreeTDS (http://www.freetds.org) to talk with ms sql, it can hand you back an utf8 string as byte char. and then you're just sitting there like 😭 because it looks cursed. this filter is the fix, bestie. πŸ’–


πŸ‘‘ METHODS πŸ‘‘

🌈 init

installs the filter as utf8_decode. that's the name you'll be piping things into, periodt. ✨

🌈 filter

receives a reference to the plugin object, along with the text to be filtered. that's the whole handshake β€” object ref + your text, in it goes. πŸ’œ


πŸŽ€ AUTHOR πŸŽ€

Fabio Masini <fabio.masini@gmail.com>


Copyright (C) 2009 Fabio Masini

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

so like, go wild, remix it, redistribute it β€” same terms as Perl itself, that's the deal. πŸ’–

and that's the whole page, bestie!! πŸ¦‹βœ¨ this doc came from perl v5.32.0, dated 2021-01-08, and honestly? iconic. go decode something. πŸ’…πŸŒΈ