Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Well, that number is 255. Saying it's a (single) byte means you've established the number of bits for it is 8.

No. You've got that backward. At the point the value is returned from pack, it isn't even a number. It is just 8 bits.

They could represent anything, including 8 physically grouped but otherwise unrelated discrete boolean values -- the current on/offness of the headlights, sidelight and tail-lights on a car; yes/no answers to a survey.

Referring to (not interpreting as) that bit pattern using 255/0377/xff is just easier than 0b11111111.

That, to me, is giving the number an interpretation. This observation is very important when it comes to the subject of encoding, especially when we're to print that character (i.e. that number).

Sorry, but you are assuming that the 8-bits represents something to do with "strings & characters and codepoints". It could just as well be 1 byte of a 4 or 8 byte memory address; or part of an IP address; or a sound level ...


The point of my asking the question was trying to make sense of the OP's (of the other thread), description. I knew that I couldn't replicate his apparent scenario on my system, but I am not familiar with the working of Unicode on *nix.

It was conceivable to me that, when running on a "unicode enabled terminal", there might be some default interpretation the byte values printed to that terminal that might be inherited by processes spawned from that terminal.

I am informed that there isn't!

But it was vaguely conceivable that there might be. And that might have been an explanation for the OPs apparent problem.


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".
In the absence of evidence, opinion is indistinguishable from prejudice.

The start of some sanity?


In reply to Re^10: Standard handles inherited from a utf-8 enabled shell by BrowserUk
in thread Standard handles inherited from a utf-8 enabled shell by BrowserUk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (5)
As of 2024-04-19 15:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found