Fixed encoding for bytes fields in the ruby interop server

pull/4345/head
murgatroid99 9 years ago
parent 59e5472568
commit a4c2d7dff7
  1. 2
      src/ruby/pb/test/server.rb

@ -126,7 +126,7 @@ end
# produces a string of null chars (\0) of length l. # produces a string of null chars (\0) of length l.
def nulls(l) def nulls(l)
fail 'requires #{l} to be +ve' if l < 0 fail 'requires #{l} to be +ve' if l < 0
[].pack('x' * l).force_encoding('utf-8') [].pack('x' * l).force_encoding('ascii-8bit')
end end
# A EnumeratorQueue wraps a Queue yielding the items added to it via each_item. # A EnumeratorQueue wraps a Queue yielding the items added to it via each_item.

Loading…
Cancel
Save