Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Re^3: Whether 'use utf8;' is good style

by chromatic (Archbishop)
on Dec 18, 2012 at 17:03 UTC ( #1009427=note: print w/replies, xml ) Need Help??

in reply to Re^2: Whether 'use utf8;' is good style
in thread Whether 'use utf8;' is good style

And I want to know whether there are pitfalls, when someone is using a module with that pragma probably expecting the good old byte string world.

What would you expect to happen in that case? (I can't imagine things working correctly except by accident.)

  • Comment on Re^3: Whether 'use utf8;' is good style

Replies are listed 'Best First'.
Re^4: Whether 'use utf8;' is good style
by Anonymous Monk on Dec 18, 2012 at 18:57 UTC

    Hi chromatic,

    does that mean you suggest avoiding use utf8; in public packages?

    Best regards

      Quite the contrary. If you have literal strings you intend for Perl to deal with in the UTF-8 encoding, you'd better use that pragma.

      If you're not explicit about Unicode and encodings, you're going to make a mess for other people to deal with. If you put UTF-8 in literals in your programs and don't use the utf8 pragma, you've acted irresponsibly.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1009427]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (11)
As of 2018-03-20 14:20 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (253 votes). Check out past polls.