diff --git a/lib/Net/LDAP/LDIF.pm b/lib/Net/LDAP/LDIF.pm index 1b7d2a7..83b6b3b 100644 --- a/lib/Net/LDAP/LDIF.pm +++ b/lib/Net/LDAP/LDIF.pm @@ -401,7 +401,7 @@ sub _write_attr { $v = Encode::encode_utf8($v) if (CHECK_UTF8 and Encode::is_utf8($v)); - if ($v =~ /(^[ :<]|[\x00-\x1f\x7f-\xff])/) { + if ($v =~ /(^[ :<]|[\x00-\x1f\x7f-\xff]| $)/) { require MIME::Base64; $ln .= ':: ' . MIME::Base64::encode($v, ''); }