diff options
author | Florian Frank <flori@ping.de> | 2016-06-02 13:23:07 +0200 |
---|---|---|
committer | Florian Frank <flori@ping.de> | 2016-06-02 13:23:07 +0200 |
commit | 6cee8d7dc22d2d8559a49ed27e79f943edd34389 (patch) | |
tree | 7eb08e90453c20c6556f1ef90a30d767e15891b3 | |
parent | cc5083707b7e6cb8699e505cd434bc7f4521412d (diff) | |
download | json-6cee8d7dc22d2d8559a49ed27e79f943edd34389.tar.gz |
Support newer rubies
-rwxr-xr-x | tools/fuzz.rb | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/tools/fuzz.rb b/tools/fuzz.rb index c0fae12..8261930 100755 --- a/tools/fuzz.rb +++ b/tools/fuzz.rb @@ -1,13 +1,5 @@ require 'json' -require 'iconv' -ISO_8859_1_TO_UTF8 = Iconv.new('utf-8', 'iso-8859-15') -class ::String - def to_utf8 - ISO_8859_1_TO_UTF8.iconv self - end -end - class Fuzzer def initialize(n, freqs = {}) sum = freqs.inject(0.0) { |s, x| s + x.last } @@ -25,7 +17,7 @@ class Fuzzer def random_string s = '' 30.times { s << @alpha[rand(@alpha.size)] } - s.to_utf8 + s end def pick |