diff --git a/src/ruby/pb/test/client.rb b/src/ruby/pb/test/client.rb index 30550d6cc0a7b473c4715bd0a3357b4c6385d5cf..329e2dc98bf74b4ecf736034c6f30992f05c2206 100755 --- a/src/ruby/pb/test/client.rb +++ b/src/ruby/pb/test/client.rb @@ -160,7 +160,7 @@ end # produces a string of null chars (\0) of length l. def nulls(l) fail 'requires #{l} to be +ve' if l < 0 - [].pack('x' * l).force_encoding('utf-8') + [].pack('x' * l).force_encoding('ascii-8bit') end # a PingPongPlayer implements the ping pong bidi test. diff --git a/src/ruby/pb/test/server.rb b/src/ruby/pb/test/server.rb index 67877a191fc96505f5040cd826568235921a439a..851e8152224188fa6b7eaeaf65b54b01a568c353 100755 --- a/src/ruby/pb/test/server.rb +++ b/src/ruby/pb/test/server.rb @@ -126,7 +126,7 @@ end # produces a string of null chars (\0) of length l. def nulls(l) fail 'requires #{l} to be +ve' if l < 0 - [].pack('x' * l).force_encoding('utf-8') + [].pack('x' * l).force_encoding('ascii-8bit') end # A EnumeratorQueue wraps a Queue yielding the items added to it via each_item.