We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6d28189 commit 4ed29f6Copy full SHA for 4ed29f6
lib/bencode/core_ext/string.rb
@@ -9,7 +9,7 @@ class String
9
# "".bencode #=> "0:"
10
#
11
def bencode
12
- "#{length}:#{self}"
+ "#{bytesize}:#{self}"
13
end
14
15
test/encoding_test.rb
@@ -1,8 +1,10 @@
1
+# encoding: utf-8
2
require 'environment'
3
4
class EncodingTest < MiniTest::Unit::TestCase
5
context "The BEncode encoder" do
6
should_encode "i42e", 42
7
should_encode "3:foo", "foo"
8
+ should_encode "5:café", "café"
0 commit comments