in reply to What is the difference between sending bytes and characters over sockets?

All characters are bytes. This sentence is full of characters that are bytes.

The only thing that might be throwing you is that some bytes don't have character representations. Go search on 'ASCII table', and you'll see that out of the 256 posible values a byte can hold, some are what you'd think of as 'printable' (for lack of a better word) characters and some are not.

If that doesn't answer your question, you'll need to post more context so we can understand the situation. But essentially: bytes eq characters.

  • Comment on Re: What is the difference between sending bytes and characters over sockets?

Replies are listed 'Best First'.
Re: Re: What is the difference between sending bytes and characters over sockets?
by hardburn (Abbot) on Feb 20, 2004 at 14:44 UTC

    But essentially: bytes eq characters.

    Except when they don't (like in many non-ASCII character sets). You can't even be sure that UTF8 will actually be one byte per character (because there is an escape code in it for multibyte encoding).

    ----
    : () { :|:& };:

    Note: All code is untested, unless otherwise stated