@@ -175,17 +175,10 @@ between valid UTF-8 bytes and valid Unicode characters.
175175
176176=item :bytes
177177
178- This is the inverse of the C<:utf8 > pseudo-layer. It turns off the flag
179- on the layer below so that data read from it is considered to
180- be Perl's internal downgraded encoding, thus interpreted as the native
181- single-byte encoding of Latin-1 or EBCDIC. Likewise on output Perl will
182- warn if a "wide" character (a codepoint not in the range 0..255) is
183- written to a such a stream.
184-
185- This is very dangerous to push on a handle using an C<:encoding > layer,
186- as such a layer assumes to be working with Perl's internal upgraded
187- encoding, so you will likely get a mangled result. Instead use C<:raw > or
188- C<:pop > to remove encoding layers.
178+ This removes all layers that do unicode IO, such as C<:utf8 > and
179+ C<:encoding > . It ensures that data read from it is considered to be
180+ "octets" i.e. characters in the range 0..255 only. Likewise on output perl
181+ will warn if a "wide" character is written to a such a stream.
189182
190183=item :raw
191184
@@ -203,9 +196,9 @@ to add C<:perlio> to the PERLIO environment variable, or open the handle
203196explicitly with that layer, to replace the platform default of C<:crlf > .
204197
205198The implementation of C<:raw > is as a pseudo-layer which when "pushed"
206- pops itself and then any layers which would modify the binary data stream.
207- (Undoing C< :utf8 > and C< : crlf> may be implemented by clearing flags
208- rather than popping layers but that is an implementation detail.)
199+ pops itself and then any layers which do not declare themselves as suitable
200+ for binary data. (Undoing : crlf is implemented by clearing a flag rather
201+ than popping the layer but that is an implementation detail.)
209202
210203As a consequence of the fact that C<:raw > normally pops layers,
211204it usually only makes sense to have it as the only or first element in
0 commit comments