Permalink
Browse files

LDIF.pm: with encode => 'canonical', do mbcescape DNs

Better standard conformance when writing LDIFs with the encode option set to
'canonical': encode multi-octet UTF-8 sequences as sequences of hexpairs,
each preceded by a backslash.
  • Loading branch information...
1 parent d76c747 commit 5f82875c70ed5b667b2b5593d86e230587f9ff18 @marschap marschap committed Sep 7, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/Net/LDAP/LDIF.pm
View
@@ -442,7 +442,7 @@ sub _write_dn {
if ($dn =~ /^[ :<]|[\x00-\x1f\x7f-\xff]/) {
if ($encode =~ /canonical/i) {
require Net::LDAP::Util;
- $dn = Net::LDAP::Util::canonical_dn($dn);
+ $dn = Net::LDAP::Util::canonical_dn($dn, mbcescape => 1);
# Canonicalizer won't fix leading spaces, colons or less-thans, which
# are special in LDIF, so we fix those up here.
$dn =~ s/^([ :<])/\\$1/;

0 comments on commit 5f82875

Please sign in to comment.