"Wide character in ..." is a warning. See "perldiag: Wide character in %s". Please stop calling it an error.

You showed this warning when using Test::More:

Wide character in print at /.../Test2/Formatter/TAP.pm line 125.

I simulated that warning when using Test::More:

Wide character in print at /.../Test2/Formatter/TAP.pm line 156.

The only difference being the line number which I'd guess, in the absence of other information, is due to you using a different version. Test::More and Test2::Formatter::TAP (along with many other modules) are part of the Test-Simple distribution. I'm using:

$ perl -E 'use Test::More; say $Test::More::VERSION;' 1.302195 $ perl -E 'use Test2::Formatter::TAP; say $Test2::Formatter::TAP::VERS +ION;' 1.302195

What version are you using?

My line 156 looks like this:

print $io $ok;

What does your line 125 look like?

I provided you with a solution to your problem by using:

use open OUT => qw{:encoding(UTF-8) :std};

Did you try that? If so, what was the outcome? If not, why not?

The issue here is in no way specific to Test::More. Consider this code which generates the warning:

$ perl -e '
    print "\N{DROMEDARY CAMEL}\n";
'
Wide character in print at -e line 2.
🐪

And this code which does not:

$ perl -e '
    use open OUT => qw{:encoding(UTF-8) :std};
    print "\N{DROMEDARY CAMEL}\n";
'
🐪

— Ken


In reply to Re^4: Listing out the characters included in a character class [wide character warning] by kcott
in thread Listing out the characters included in a character class by Polyglot

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.