Skip to content

Commit ab7b60c

Browse files
committed
Force encoding to ASCII-8BIT
We allow this since the library requires Ruby 1.9+
1 parent 480bd17 commit ab7b60c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/net/ber/core_ext/true_class.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ module Net::BER::Extensions::TrueClass
66
# Converts +true+ to the BER wireline representation of +true+.
77
def to_ber
88
# http://tools.ietf.org/html/rfc4511#section-5.1
9-
"\001\001\xFF"
9+
"\001\001\xFF".force_encoding("ASCII-8BIT")
1010
end
1111
end

test/ber/test_ber.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def test_array
1414

1515
# http://tools.ietf.org/html/rfc4511#section-5.1
1616
def test_true
17-
assert_equal "\x01\x01\xFF", true.to_ber
17+
assert_equal "\x01\x01\xFF".b, true.to_ber
1818
end
1919

2020
def test_false

0 commit comments

Comments
 (0)