Skip to content

Commit 3a101be

Browse files
committed
Server strings are always UTF-8
1 parent f154eb3 commit 3a101be

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/net/ber.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,9 +296,8 @@ def to_arr
296296
class Net::BER::BerIdentifiedString < String
297297
attr_accessor :ber_identifier
298298
def initialize args
299+
args.force_encoding('UTF-8') if args.respond_to(:force_encoding)
299300
super args
300-
# LDAP uses UTF-8 encoded strings
301-
self.encode('UTF-8') if self.respond_to?(:encoding) rescue self
302301
end
303302
end
304303

0 commit comments

Comments
 (0)