Merge pull request #33 from DavidJLee/master
New filter type to allow searching of binary data
This commit is contained in:
commit
b6d9fbebfd
5 changed files with 50 additions and 2 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