Thread (41 messages) flat view 41 messages, 4 authors, 2016-06-15

Re: [PATCHv5 06/17] gitweb/lib - Simple select(FH) based output capture

From: Ævar Arnfjörð Bjarmason <hidden>
Date: 2016-06-15 22:49:43

On Wed, Oct 6, 2010 at 22:01, Jakub Narebski [off-list ref] wrote:
* The most important issue is that I/O "layers" (PerlIO), like ':utf8'
 or ':raw', are *already applied* to the output that is captured.
 This means that captured output is *always* in binary (':raw') mode.
 In Perl 6 language it means that data returned by capturing engine
 is an equivalent of Buf, a collection of bytes, whether Buf or Str
 (a colection of logical characters) is printed.
+       # note: this does not cover all cases
+       binmode select(), ':utf8'
+               if ((PerlIO::get_layers($self->{'oldfh'}))[-1] eq 'utf8');
I'm not sure but maybe we want to use ":Encoding(UTF-8)" everywhere in
this series where you've used ":utf8". I.e. use the Encoding UTF-8
layer instead of the internal utf8 layer.

It's more strict, see perldoc Encode's "UTF-8 vs. utf8 vs. UTF8". But
maybe we don't care.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help