Added a new filter type bineq that will create an equality filter and NOT force
convert data to UTF-8. This is required for proper binary data filters in Microsoft Active Directory.
This commit is contained in:
parent
3345c58dfb
commit
c46c93777e
4 changed files with 37 additions and 1 deletions
|
@ -16,6 +16,14 @@ module Net::BER::Extensions::String
|
|||
[code].pack('C') + raw_string.length.to_ber_length_encoding + raw_string
|
||||
end
|
||||
|
||||
##
|
||||
# Converts a string to a BER string but does *not* encode to UTF-8 first.
|
||||
# This is required for proper representation of binary data for Microsoft
|
||||
# Active Directory
|
||||
def to_ber_bin(code = 0x04)
|
||||
[code].pack('C') + length.to_ber_length_encoding + self
|
||||
end
|
||||
|
||||
def raw_utf8_encoded
|
||||
if self.respond_to?(:encode)
|
||||
# Strings should be UTF-8 encoded according to LDAP.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue