1Test2::Plugin::UTF8(3)User Contributed Perl DocumentationTest2::Plugin::UTF8(3)
2
3
4
6 Test2::Plugin::UTF8 - Test2 plugin to test with utf8.
7
9 When used, this plugin will make tests work with utf8. This includes
10 turning on the utf8 pragma and updating the Test2 output formatter to
11 use utf8.
12
14 use Test2::Plugin::UTF8;
15
16 This is similar to:
17
18 use utf8;
19 BEGIN {
20 require Test2::Tools::Encoding;
21 Test2::Tools::Encoding::set_encoding('utf8');
22 }
23
24 You can also disable the utf8 import by using 'encoding_only' to only
25 enable utf8 encoding on the output format.
26
27 use Test2::Plugin::UTF8 qw(encoding_only);
28
30 encoding_only
31 Does not import utf8 in your test and only enables the encoding mode on
32 the output.
33
35 This module currently sets output handles to have the ':utf8' output
36 layer. Some might prefer ':encoding(utf-8)' which is more strict about
37 verifying characters. There is a debate about whether or not encoding
38 to utf8 from perl internals can ever fail, so it may not matter. This
39 was also chosen because the alternative causes threads to segfault, see
40 perlbug 31923 <https://rt.perl.org/Public/Bug/Display.html?id=31923>.
41
43 The source code repository for Test2-Suite can be found at
44 https://github.com/Test-More/Test2-Suite/.
45
47 Chad Granum <exodist@cpan.org>
48
50 Chad Granum <exodist@cpan.org>
51
53 Copyright 2018 Chad Granum <exodist@cpan.org>.
54
55 This program is free software; you can redistribute it and/or modify it
56 under the same terms as Perl itself.
57
58 See http://dev.perl.org/licenses/
59
60
61
62perl v5.32.0 2020-12-16 Test2::Plugin::UTF8(3)