in reply to Re: How to print "FACE WITH TEARS OF JOY" in command line?
in thread How to print "FACE WITH TEARS OF JOY" in command line?

Or, since the question is about the command line, using -CO as argument to perl.

Replies are listed 'Best First'.
Re^3: How to print "FACE WITH TEARS OF JOY" in command line?
by Tux (Canon) on Mar 13, 2012 at 10:45 UTC

    Almost correct: C2 not C0. And with perl-5.16, you don't even need to load charnames ☺

    % bleadperl -C2 -E'say"\N{FACE WITH TEARS OF JOY}"'
    😂

    Enjoy, Have FUN! H.Merijn
      I did not suggest -C0, I said -CO, as in capital o, not the number 0. From man perlrun:
      As of 5.8.1, the "-C" can be followed either by a number or a list of option letters. The letters, their numeric values, and effects are as follows; listing the letters is equal to summing the numbers. I 1 STDIN is assumed to be in UTF-8 O 2 STDOUT will be in UTF-8 E 4 STDERR will be in UTF-8 S 7 I + O + E i 8 UTF-8 is the default PerlIO layer for input streams o 16 UTF-8 is the default PerlIO layer for output streams D 24 i + o A 32 the @ARGV elements are expected to be strings encoded in UTF-8 L 64 normally the "IOEioA" are unconditional, the L makes them conditional on the locale environment variables (the LC_ALL, LC_TYPE, and LANG, in the order of decreasing precedence) -- if the variables indicate UTF-8, then the selected "IOEioA" are in effect a 256 Set ${^UTF8CACHE} to -1, to run the UTF-8 caching code i +n debugging mode.

        Mea culpa. /me is too used to using digits I didn't see.


        Enjoy, Have FUN! H.Merijn