Understanding Perl and Encodings

ambs on 2009-07-02T21:31:55

I still did not get the grip on Encodings and Perl. I have an UTF8 file that I want to process. This process calls a module that I know uses a bidirectional pipe with an latin1 process. But that should be hidden...

So, I am reading with <> operator, and printing with print. If I do not say a thing, I get output correct (UTF8) but the module does not work. If I put 'use encoding utf8', I get input and output correct, but the module does not work. If I put 'use open utf8' I get the module working, but no correct output. If I add the binmode for the STDOUT, it works. And finally, if I remove 'use open' and add a binmode for STDIN, it does not work, as <> is not affected by that.

Finally, I was hopping that 'use open utf8' would work for it all. Unfortunately it doesn't. Perl 5.10.0, btw.

Ideas, suggestions, corrections, are welcome.


references i've found useful

ddick on 2009-07-03T00:31:41

are covered in a talk by Stephen Edmonds. The talk has also has a list of references at the end