in reply to Re^3: Bypass utf-8 encoding/decoding?
in thread Bypass utf-8 encoding/decoding?

Quite right, of course. But I was surprised today while playing with using the official name for Unicode characters to find that it's not needed in that case:

use strict; use warnings; use feature 'say'; #use utf8; use open qw( :encoding(UTF-8) :std ); say "\N{FATHER CHRISTMAS} thanks you for all your hard work tonight"; __END__

🎅 thanks you for all your hard work tonight

use strict; use warnings; use feature 'say';
#use utf8;
use open qw( :encoding(UTF-8) :std );
say "🎅 thanks you for all your hard work tonight";
__END__

🎅 thanks you for all your hard work tonight


The way forward always starts with a minimal test.

Replies are listed 'Best First'.
Re^5: Bypass utf-8 encoding/decoding?
by 1nickt (Canon) on Dec 01, 2017 at 14:01 UTC

    Well, spend a little time in the PerlMonks Chatterbox and you'll learn something ...

    To answer my question above, see charnames:

    "Pragma use charnames is used to gain access to the names of the Unicode characters and named character sequences ..."

    "Starting in Perl v5.16, any occurrence of \N{CHARNAME} sequences in a double-quotish string automatically loads this module ..."

    Thanks choroba for pointing to this pragma.


    The way forward always starts with a minimal test.
      "...spend a little time...and you'll learn something..."

      👏 Best regards, Karl

      «The Crux of the Biscuit is the Apostrophe»

      perl -MCrypt::CBC -E 'say Crypt::CBC->new(-key=>'kgb',-cipher=>"Blowfish")->decrypt_hex($ENV{KARL});'Help