Skip to content

Commit

Permalink
Merge pull request ruby-ldap#212 from cmdrclueless/utf8_strings
Browse files Browse the repository at this point in the history
Correctly set BerIdentifiedString values to UTF-8
  • Loading branch information
jch committed Sep 18, 2015
2 parents ea0c058 + 5817269 commit 32db6eb
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/net/ber.rb
Original file line number Diff line number Diff line change
Expand Up @@ -296,9 +296,11 @@ def to_arr
class Net::BER::BerIdentifiedString < String
attr_accessor :ber_identifier
def initialize args
super args
# LDAP uses UTF-8 encoded strings
self.encode('UTF-8') if self.respond_to?(:encoding) rescue self
super begin
args.respond_to?(:encode) ? args.encode('UTF-8') : args
rescue
args
end
end
end

Expand Down

0 comments on commit 32db6eb

Please sign in to comment.