Skip to content

Correctly set BerIdentifiedString values to UTF-8 #212

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 18, 2015
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Correctly encode to UTF-8 when possible
  • Loading branch information
cmdrclueless committed Aug 25, 2015
commit 04125c73f71b9da207d1a5cb31996f73f072d33c
7 changes: 5 additions & 2 deletions lib/net/ber.rb
Original file line number Diff line number Diff line change
Expand Up @@ -296,8 +296,11 @@ def to_arr
class Net::BER::BerIdentifiedString < String
attr_accessor :ber_identifier
def initialize args
args.force_encoding('UTF-8') if args.respond_to(:force_encoding)
super args
super begin
args.respond_to?(:encode) ? args.encode('UTF-8') : args
rescue
args
end
end
end

Expand Down