Re: Using :encoding and :crlf together?
[email protected] (Ciaran Hamilton) Tue, 07 Feb 2006 12:36:22 +0000
| Newsgroups | perl.i18n |
|---|---|
| Message-ID | <[email protected]> |
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.