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

Re: minimalist perl-utf8 question

by quester (Vicar)
on Feb 02, 2013 at 06:36 UTC ( #1016653=note: print w/replies, xml ) Need Help??


in reply to minimalist perl-utf8 question

You need to mark STDOUT as being in UTF-8. Either binmode ..., ":encoding(UTF-8)"; or the slightly cryptic perl -C2 option will work:

$ perl -wE 'use utf8; binmode STDOUT, ":encoding(UTF-8)"; print "ייייי + ", length "ייייי", "\n";'

prints

ייייי 5

$ perl -C2 -wE 'use utf8; print "ייייי ", length "ייייי", "\n";'

prints

ייייי 5

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1016653]
help
Chatterbox?
[choroba]: Hoorn?
[choroba]: Merkine?
[erix]: Nashorn is Diceros not monoceros
[choroba]: Seefeld in Tirol?
[shmem]: this

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (10)
As of 2017-03-30 17:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (362 votes). Check out past polls.