lib/net/ldap/filter.rb
##
# Converts escaped characters (e.g., "\\28") to unescaped characters
# @note slawson20170317: Don't attempt to unescape 16 byte binary data which we assume are objectGUIDs
# The binary form of 5936AE79-664F-44EA-BCCB-5C39399514C6 triggers a BINARY -> UTF-8 conversion error
Converts escaped characters  to unescaped characters
Converts escaped characters to unescaped characters
def unescape(right)
    right = right.to_s
    if right.length == 16 && right.encoding == Encoding::BINARY
      right
    else
      right.to_s.gsub(/\\([a-fA-F\d]{2})/) { [$1.hex].pack("U") }
    end
  end
def unescape ( right ) right = right . to_s if right . length == 16 && right . encoding == Encoding :: BINARY right else right . to_s . gsub ( / \\ ([a-fA-F \d ]{2}) / ) { [ $1 . hex ] . pack ( "U" ) } end end
Converts escaped characters (e.g., "\\28") to unescaped characters
Converts escaped characters ( e . g . " \\ 28 " ) to unescaped characters
right
<not_specific>
note
Don't attempt to unescape 16 byte binary data which we assume are objectGUIDs The binary form of 5936AE79-664F-44EA-BCCB-5C39399514C6 triggers a BINARY -> UTF-8 conversion error
Don ' t attempt to unescape 16 byte binary data which we assume are objectGUIDs The binary form of 5936AE79 - 664F - 44EA - BCCB - 5C39399514C6 triggers a BINARY - > UTF - 8 conversion error