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.
2 parents 8acd4ac + 656039c commit ccd7b6dCopy full SHA for ccd7b6d
lib/net/ber/core_ext/string.rb
@@ -28,7 +28,11 @@ def raw_utf8_encoded
28
if self.respond_to?(:encode)
29
# Strings should be UTF-8 encoded according to LDAP.
30
# However, the BER code is not necessarily valid UTF-8
31
- self.encode('UTF-8').force_encoding('ASCII-8BIT')
+ begin
32
+ self.encode('UTF-8').force_encoding('ASCII-8BIT')
33
+ rescue Encoding::UndefinedConversionError
34
+ self
35
+ end
36
else
37
self
38
end
0 commit comments