http://qs321.pair.com?node_id=868489


in reply to Chicanery Needed to Handle Unicode Text on Microsoft Windows

Can someone explain how this sequence of PerlIO layers works?

The default is

:perlio:crlf

If you add encoding layer it becomes

:perlio:crlf:encoding(UTF-16le)

The order is backwards. CRLF processing is done before decoding on read and after encoding on write. Buggy! the following is desired:

:perlio:encoding(UTF-16le):crlf

:raw cleans the slate, allowing you to get the desired order.