Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Character in 'b' format wrapped in unpack

by choroba (Cardinal)
on Mar 28, 2015 at 15:21 UTC ( [id://1121668]=note: print w/replies, xml ) Need Help??


in reply to Character in 'b' format wrapped in unpack

Did the shifting manage to create a wide character?
It seems so. I added
print $x:

to the script and now I'm getting:

Wide character in say at ./1.pl line 10.

The output through xxd:

0000000: c2aa c594 c2aa c594 0a30 3130 3130 3130 .........0101010 0000010: 3130 3031 3031 3031 3030 3130 3130 3130 1001010100101010 0000020: 3130 3031 3031 3031 300a 100101010.
لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Replies are listed 'Best First'.
Re^2: Character in 'b' format wrapped in unpack
by BrowserUk (Patriarch) on Mar 28, 2015 at 15:47 UTC

    Dratted Unicrap bites again!


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority". I'm with torvalds on this
    In the absence of evidence, opinion is indistinguishable from prejudice. Agile (and TDD) debunked
      Use bytes.
      لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

        Good call. I'd completely forgotten about that pragma. Thanks.


        With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority". I'm with torvalds on this
        In the absence of evidence, opinion is indistinguishable from prejudice. Agile (and TDD) debunked
      The only involvement of Unicode is the use of UTF-8 when you provided invalid data to print. That usually means you forgot to encode the argument, so Perl does it for you (but warns you that it did.) Don't pass invalid data to print, and Unicode won't be involved.
        The only involvement of Unicode is the use of UTF-8 when you provided invalid data to print

        Utter twaddle!

        The unicrap 'manifests' regardless of whether you call print:

        C:\test>perl -MDevel::Peek -E"$x = '--*--'; substr($x,2,1) = chr(~0); +Dump( $x )" SV = PVMG(0x250e68) at 0x2669c8 REFCNT = 2 FLAGS = (SMG,POK,pPOK,UTF8) IV = 0 NV = 0 PV = 0x252e48 "--\377\200\217\277\277\277\277\277\277\277\277\277\27 +7--"\0 [UTF8 "--\x{ffffffffffffffff}--"] CUR = 17 LEN = 24 MAGIC = 0x2b66a8 MG_VIRTUAL = &PL_vtbl_utf8 MG_TYPE = PERL_MAGIC_utf8(w) MG_LEN = -1

        Perl has silently and unwantedly f***** my data. Broken!


        With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority". I'm with torvalds on this
        In the absence of evidence, opinion is indistinguishable from prejudice. Agile (and TDD) debunked

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1121668]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (4)
As of 2024-04-26 08:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found