Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Re: wide character warning!

by Loops (Curate)
on Nov 06, 2014 at 09:25 UTC ( #1106342=note: print w/replies, xml ) Need Help??

in reply to wide character warning!

Hi, and welcome to the monastery.

If you add "use diagnostics;" in addition to your "use 5.018;" Perl will give you a helpful error with a solution:

binmode STDOUT, ':utf8';

Although another choice if you want to configure all of Perl's Unicode options is the utf8::all module.

Replies are listed 'Best First'.
Re^2: wide character warning!
by 2teez (Vicar) on Nov 06, 2014 at 19:21 UTC

    Just a Note:
    ":utf8" only marks the data as UTF-8 without checking whether the data is a valid UTF-8, meanwhile ":encoding(UTF-8)" checks that the data are actually valid UTF-8.
    So, I will rather write:

    binmode(STDOUT, ":encoding(utf8)");

    If you tell me, I'll forget.
    If you show me, I'll remember.
    if you involve me, I'll understand.
    --- Author unknown to me

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1106342]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (6)
As of 2022-05-23 00:03 GMT
Find Nodes?
    Voting Booth?
    Do you prefer to work remotely?

    Results (81 votes). Check out past polls.