Skip to content

Commit a83fb32

Browse files
committed
Server strings are always UTF-8
1 parent e7fde22 commit a83fb32

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/net/ber.rb

+1-2
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)