Locale::TextDomain::UTF8 - Shortcut to use Locale::TextDomain and decoding to UTF8
This document describes version 0.020 of Locale::TextDomain::UTF8 (from Perl distribution Locale-TextDomain-UTF8), released on 2019-12-26.
Instead of:
use Locale::TextDomain 'Some-TextDomain';
you now say:
use Locale::TextDomain::UTF8 'Some-TextDomain';
use Locale::TextDomain::UTF8 'Some-TextDomain'
is equivalent to:
use Locale::TextDomain 'Some-TextDomain'; use Locale::Messages qw(bind_textdomain_filter); use Encode; BEGIN { $ENV{OUTPUT_CHARSET} = 'UTF-8'; bind_textdomain_filter 'Some-TextDomain' => \&Encode::decode_utf8; }
it's just more convenient, especially if you have to do it for each textdomain.
Why would you want this? To ensure that strings returned by the __(), et al functions are UTF8-encoded Perl strings. For example, if you want to pass the strings to Unicode::GCString. For more details, see the Perl Advent article mentioned in the SEE ALSO section.
__()
Please visit the project's homepage at https://metacpan.org/release/Locale-TextDomain-UTF8.
Source repository is at https://github.com/perlancar/perl-Locale-TextDomain-UTF8.
Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=Locale-TextDomain-UTF8
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.
Locale::TextDomain::UTF8::IfEnv
Locale::TextDomain
Locale::Messages
http://www.perladvent.org/2013/2013-12-09.html
perlancar <perlancar@cpan.org>
This software is copyright (c) 2019, 2013 by perlancar@cpan.org.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Locale::TextDomain::UTF8, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Locale::TextDomain::UTF8
CPAN shell
perl -MCPAN -e shell install Locale::TextDomain::UTF8
For more information on module installation, please visit the detailed CPAN module installation guide.