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

No. use utf8; tells Perl that the source code contains UTF-8 characters (and you can use them in identifiers, too). It's in no way related to how external data are encoded/decoded.

($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,

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

    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.

      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

Re^4: Bypass utf-8 encoding/decoding?
by karlgoethebier (Abbot) on Dec 01, 2017 at 10:09 UTC
    "...no way related..."

    I begin to see it clearly now ;-) Thanks and 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