quick pure perl question

2009-06-28 Thread André Warnier
Hi. By curiosity, and just in case anyone knows off-hand : perl 5.8.8 In a script, I substantially do this : open(FIRST,'<:utf8',$name1); open(SECOND,'>:raw',$name2); while(defined($line = )) { print SECOND $line; } and I get warnings : "wide character in print to ,.." I mean, I know that my

Re: quick pure perl question

2009-06-28 Thread Mike OK
Check out this man page http://perldoc.perl.org/functions/open.html For encoding UTF8, the example is open(FH, "<:encoding(UTF-8)", "file") Mike - Original Message - From: "André Warnier" To: "mod_perl list" Sent: Sunday, June 28, 2009

Re: quick pure perl question

2009-06-28 Thread Bill Moseley
On Sun, Jun 28, 2009 at 8:41 AM, André Warnier wrote: > Hi. > By curiosity, and just in case anyone knows off-hand : > > perl 5.8.8 > > In a script, I substantially do this : > > open(FIRST,'<:utf8',$name1); > open(SECOND,'>:raw',$name2); > while(defined($line = )) { >  print SECOND $line; > } > >

Re: quick pure perl question

2009-06-30 Thread Andy Armstrong
On 28 Jun 2009, at 17:33, Bill Moseley wrote: You need to encode the character data before writing back out either by encoding explicitly or using a layer. Or possibly not decode it in the first place and treat it as an opaque octet stream. All depending, of course, on what it is you're tryi

Re: quick pure perl question

2009-06-30 Thread André Warnier
Andy Armstrong wrote: On 28 Jun 2009, at 17:33, Bill Moseley wrote: You need to encode the character data before writing back out either by encoding explicitly or using a layer. Or possibly not decode it in the first place and treat it as an opaque octet stream. All depending, of course, on

Re: quick pure perl question

2009-06-30 Thread Andy Armstrong
On 30 Jun 2009, at 14:13, André Warnier wrote: I /would/ have expected it if I was /not/ specifying an encoding, like using simply '>'. But not when I am explicitly specifying '>:raw', which in my mind, and according to my interpretation of the on-line documentation, is equivalent to saying

Re: quick pure perl question

2009-06-30 Thread Bill Moseley
On Tue, Jun 30, 2009 at 6:13 AM, André Warnier wrote: > Basically, by using the '>:raw' encoding for the output stream, I was not > expecting perl to warn me that I was (knowingly) outputting "wide > characters" there, so I was surprised at the warning. > > I /would/ have expected it if I was /no