Hi Graham,

Graham Barr a écrit :
Perl v5.8.7, Convert::ASN1 v0.19 and Net::LDAP v0.31. These are the latest on my distro (Mandriva Cooker). Should I wait/install more recent packages ?


Hm, they should be ok.

Can you expand a bit more on what you mean by re-encoding by hand. Can you send a code snippet that shows what you find yourself having to do.

        Someone on the gtk2-perl list told me to do the following thing:

-------------------------------------------------------
    use Encode;
    $info = decode_utf8( get_info_from_ldap_somehow() );
-------------------------------------------------------

        and when I do this and then put the $info in a Gtk2 widget, it works ok.

        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 ?

        Thanks,
--
   \^/
 -/ O \----------------------------------------
| |/ \|       Alexandre (Midnite) Jousset      |
 -|___|----------------------------------------

Reply via email to