Code Comments
Programming Forum and web based access to our favorite programming groups.I have found a previous thread on this list concerning the Active
Directory change password facility. This describes using the following
fragment of code to build the Unicode password encoding to pass through
to active directory.
my $charmap = Unicode::Map8->new('latin1');
my $unicodePwd = $charmap->tou('"'.$password.'"')->byteswap()->utf16();
This works for me so long as $password contains ASCII characters.
However if this is a string including for example '£' (english pound
sign) characters then the string encoding sent through to AD contains
something not quite right.
I suspect I need a different charmap but what would be suitable? Am I
right that this is what is wrong?
Howard.
Post Follow-up to this messageOn Fri, Apr 18, 2008 at 02:38:43PM +0100, Howard Wilkinson wrote:
> I suspect I need a different charmap but what would be suitable? Am I
> right that this is what is wrong?
well ... i wrote an easy to use wrapper over Net::LDAP I use for a
while. In this one, i have this code:
use Encode;
sub passwd {
my ( $entry , $passwd ) = @_ ;
$entry->replace( unicodePwd =>
Encode::encode('UTF-16LE',qq("$passwd") )
);
}
does is works better?
regards
mc
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.