On Mon, September 19, 2005 12:13 pm, Eugene Gladchenko wrote:
> Alexandre Jousset wrote:
>
>
>>       I wrote a small test app like this:
>> -------------------------------------------------------
>> #!/usr/bin/perl -w
>>
>> use strict;
>> use utf8;
>> use encoding 'utf8';
>>
>> use Net::LDAP;
>>
>> my $ldap = Net::LDAP->new('localhost', version => 3);
>>
>> unless ($ldap) {
>>      die "Could not connect to localhost: $@";
>> }
>>
>> my ($dn, $passwd) = ('cn=admin,dc=exemple,dc=com', 'mypass');
>>
>> my $mesg = $ldap->bind(dn => $dn, password => $passwd);
>> if ($mesg->is_error) {
>>      die "LDAP bind failed: " . $mesg->error;
>> }
>>
>> print "schema = " . $ldap->schema;
>> -------------------------------------------------------
>>
>> And when used like this, it gets an undef'd schema. If I remove the
>> "use encoding 'utf8';" line, it works ok.
>>
>> Do you need something else ? Am I doing something wrong ?
>>
>
> Confirmed.
>
> When I add "use encoding 'utf8';" line into my scripts I get
>
> Net::LDAP encountered an error while decoding a response packet from
> the server

I find this very odd. The encoding pragma is not supposed to change how
perl treats anything other than the sctual script in the file that the
pragma is in. It allows you to write in any encoding and perl will
translate that to utf8 when it parses the script.

Maybe the pragma is doingmore than it should

Graham.

>
> and
>
> Bad sequence length  at
> /usr/local/lib/perl5/site_perl/5.8.7/Convert/ASN1/Debug.pm line 79,
> <DATA> line 424.
> ...
> ...
> Use of uninitialized value in addition (+) at
> /usr/local/lib/perl5/site_perl/5.8.7/Convert/ASN1/Debug.pm line 88,
> <DATA> line 424.
> Use of uninitialized value in printf at
> /usr/local/lib/perl5/site_perl/5.8.7/Convert/ASN1/Debug.pm line 94,
> <DATA> line 424.
> ...
>
> in the debug(15) output.
>
> FreeBSD 5.4-RELEASE-p4, perl 5.8.7, Convert::ASN1 0.18, perl-ldap 0.33.
>
> Any ideas?
>
> --
> Eugene Gladchenko,
> EVG15-RIPE
>
>
>
>


Reply via email to