On Tue, Jun 30, 2009 at 6:13 AM, André Warnier <a...@ice-sa.com> wrote:

> Basically, by using the '>:raw' encoding for the output stream, I was not
> expecting perl to warn me that I was (knowingly) outputting "wide
> characters" there, so I was surprised at the warning.
>
> I /would/ have expected it if I was /not/ specifying an encoding, like
> using simply '>'.  But not when I am explicitly specifying '>:raw', which in
> my mind, and according to my interpretation of the on-line documentation, is
> equivalent to saying "output whatever you have as bytes in that string
> variable right now, as is, I know what I'm doing".


I think it's because it's not bytes.  Well, technically it's bytes of
course, but conceptually once you decode bytes you no longer have bytes.
You have that abstract idea of characters.  And the only way to output that
information into a file (which hold bytes) is by first converting it to
bytes, and that requires encoding.

It's just like a thought you have in your brain.  I'm not aware of any way
(yet) to output that in raw format -- must be encoded into typed, spoken, or
signed language first.  Even if most of what I write would be considered
pretty raw.

Isn't :raw mostly a way to use layers to say don't do CRLF conversion --
like the old use of binmode()?  Oh, maybe not according to the docs.
It's best to decode and encode all character data at program boundaries and
stay away form Windows.


-- 
Bill Moseley
mose...@hank.org

Reply via email to