We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 51597ea commit 656039cCopy full SHA for 656039c
lib/net/ber/core_ext/string.rb
@@ -20,7 +20,11 @@ def raw_utf8_encoded
20
if self.respond_to?(:encode)
21
# Strings should be UTF-8 encoded according to LDAP.
22
# However, the BER code is not necessarily valid UTF-8
23
- self.encode('UTF-8').force_encoding('ASCII-8BIT')
+ begin
24
+ self.encode('UTF-8').force_encoding('ASCII-8BIT')
25
+ rescue Encoding::UndefinedConversionError
26
+ self
27
+ end
28
else
29
self
30
end
0 commit comments