perl-i18n

Re: Using :encoding and :crlf together?

2006-02-07 05:38:31
Hi,

I won't post again about this unless I manage to solve the problem. Sorry again for spamming the list.

I've managed to find a workaround, and I believe that what I've seen is a bug. I've submitted a report via perlbug.

The workaround is to install PerlIO::eol from CPAN and use ":eol(CRLF)" instead of ":crlf":

---
#!/usr/bin/perl

open(FILE, ">:encoding(UTF-16):eol(CRLF)", "test");
print FILE "Test \x{A3}45!\n";
print FILE "Test!\n";
close(FILE);
---

The above file works perfectly and the test file contains the expected output.

I haven't managed to test this on ActiveState yet as it's not in PPM. I've submitted a request for it to be on PPM. :D

 - Ciaran.

<Prev in Thread] Current Thread [Next in Thread>