in reply to Re^6: Standard handles inherited from a utf-8 enabled shell
in thread Standard handles inherited from a utf-8 enabled shell
That's not how I see it. I see the system-ed perl as an autonomous process (unknowing of its parent process) with its STDOUT filehandle set with different encodings.
In both cases, we're printing out a string with one character at codepoint U+00FF.
The second system-ed perl has its output encoding set to UTF-8 (via -CO). What octets do we send out into the cruel world for U+00FF character encoded in UTF-8? Ans: c3 bf.
The first system-ed perl has its output "set" to byte/Latin-1 encoding (the default). What octets do we send out into the cruel world for U+00FF character encoded in Latin-1? Ans: ff.
The first case did not print c3 bf just because of the parent perl -CO because the system print did not go through the parent's perlio.
In both cases, we're printing out a string with one character at codepoint U+00FF.
The second system-ed perl has its output encoding set to UTF-8 (via -CO). What octets do we send out into the cruel world for U+00FF character encoded in UTF-8? Ans: c3 bf.
The first system-ed perl has its output "set" to byte/Latin-1 encoding (the default). What octets do we send out into the cruel world for U+00FF character encoded in Latin-1? Ans: ff.
The first case did not print c3 bf just because of the parent perl -CO because the system print did not go through the parent's perlio.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^8: Standard handles inherited from a utf-8 enabled shell
by BrowserUk (Patriarch) on Mar 22, 2012 at 05:59 UTC | |
by repellent (Priest) on Mar 22, 2012 at 09:59 UTC | |
by BrowserUk (Patriarch) on Mar 22, 2012 at 11:38 UTC |
In Section
Seekers of Perl Wisdom