develooper Front page | perl.i18n | Postings from February 2006

Re: Using :encoding and :crlf together?

Thread Previous | Thread Next
From:
Ciaran Hamilton
Date:
February 7, 2006 04:38
Subject:
Re: Using :encoding and :crlf together?
Message ID:
43E89446.1000301@tnauk.org.uk
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.

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About