|Think about Loose Coupling|
Re^3: Chicanery Needed to Handle Unicode Text on Microsoft Windowsby Anonymous Monk
|on Oct 30, 2010 at 22:29 UTC||Need Help??|
...to trust thatFor older versions of Perl (<= 5.8.8), you'd need an additional :utf8 layer at the end, i.e.is the best, right way to handle Unicode text in Perl on Windows.
(although this isn't needed with newer versions, it doesn't do any harm either)
Without it, the strings would end up without the utf8 flag set (upon reading), which means that Perl wouldn't treat them as text/unicode strings in regex comparisons, etc., as it should. Similarly for writing.
5.8.8 output (wrong):
Output with newer versions (correct):
This seems to be the only thing that's been fixed in the meantime.
I think this only goes to prove your point that this is way too arcane for mere mortals... And, even though there is a "solution" to the issue, the current behavior of the :crlf layer is definitely a bug, IMHO. For one, it violates the principle of least surprise. Instead, the following straightforward approach (as anyone sane in his mind would glean from the existing documentation) should work: