Templa...ceUTF8(3pm)
π Template::Stash::ForceUTF8 β the 3pm girlie who forces the flag π
okay so bestie, this one lives in the Perl User Contributed docs corner of the manual, page name Templa...ceUTF8 (yes the title's been snipped, it's giving mystery, iykyk) and the manual section is 3pm. Let's get into it β¨
β¨ NAME β¨
Template::Stash::ForceUTF8 β it forces the UTF-8 (Unicode) flag onto your stash variables. no cap. that's the whole job and she does it flawlessly π
πΈ SYNOPSIS πΈ
here's the vibe, copy-paste energy, do not touch a single character:
use Template::Stash::ForceUTF8;
use Template;
my $tt = Template->new(
LOAD_TEMPLATES => [ Template::Provider::Encoding->new ],
STASH => Template::Stash::ForceUTF8->new,
);
my $vars;
$vars->{foo} = "\x{5bae}\x{5ddd}"; # Unicode flagged
$vars->{bar} = "\xe5\xae\xae\xe5\xb7\x9d"; # UTF-8 bytes
$tt->process($template, $vars); # this DWIMs
look at that last comment. # this DWIMs. she literally does what you mean. main character behaviour fr fr π«Ά
π¦ DESCRIPTION π¦
Template::Stash::ForceUTF8 is a Template::Stash that forces the Unicode flag on stash variables. that's it, that's the tea β
and the glow-up tip: she is best used with Template::Provider::Encoding. they're a duo. a duo that ate π
β¨
π₯ SEE ALSO π₯
Template::Provider::Encodingβ her partner in crime, go read that one too bestie
lowkey reminder: you're getting a <pink>Template::Stash</pink> subclass here, not a whole new templating engine. keep your expectations iconic and realistic π
this page shipped with perl v5.34.0 and was dated 2022-06-17, straight out of the User Contributed Perl Documentation corner of the world. mwah, go force some flags on your stash, you've got this πππ§βπ
π¦ where this page comes from
- debian bookworm: libtemplate-provider-encoding-perl 0.10-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libtemplate-provider-encoding-perl 0.10-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libtemplate-provider-encoding-perl 0.10-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libtemplate-provider-encoding-perl 0.10-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libtemplate-provider-encoding-perl 0.10-4 Β· 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