Hi,
On Friday 02 April 2004 14:08, jehan.procaccia wrote:
> Chris Ridd wrote:
> >It wouldn't be a problem with something trying to utf8 encode the data
> > would it?
>
> Indeed ! I know I had lot of problems with utf8 ... so here's my test on
> that after removing binmode(TMP) from my script:
> $ echo $LANG
> en_US.UTF-8
> $ ./exportjpegphoto.pl
> $ file photos/procacci
> photos/procacci: data
>
> file not viewable :-(
>
> $ export LANG=en_US
> $ ./exportjpegphoto.pl
> $ file photos/procacci
> photos/procacci: JPEG image data, JFIF standard 1.01, aspect ratio, 1 x 1
>
> Great that's it :-)
> So what is the best solution, playing with export LANG or use binmode() ?
in my opinion using binode is the correct solution.
This is also what `man perlfunc` says in the paragraphs about binmode:
In other words: regardless of platform, use binmode() on binary data,
like for example images.
I have added the binmode() call to the examples in the perl-ldap SVN.
Yours
Peter
--
Peter Marschall
eMail: [EMAIL PROTECTED]