Skip to content

Commit

Permalink
Fix conversion crash on 1.9
Browse files Browse the repository at this point in the history
  • Loading branch information
flori committed Jan 12, 2017
1 parent 2bcacc1 commit 7f05140
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 6 deletions.
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ language: ruby

# Specify which ruby versions you wish to run your tests on, each version will be used
rvm:
- 1.8.7
- 1.9.1
- 1.9.2
- 1.9.3
- 2.0.0
- 2.1
- 2.2
Expand Down
4 changes: 2 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ if defined?(Gem) and defined?(Gem::PackageTask)
s.email = "[email protected]"
s.homepage = "http://flori.github.com/#{PKG_NAME}"
s.license = 'Ruby'
s.required_ruby_version = '~>2.0'
#s.required_ruby_version = '~>2.0'
end

desc 'Creates a json_pure.gemspec file'
Expand Down Expand Up @@ -133,7 +133,7 @@ if defined?(Gem) and defined?(Gem::PackageTask)
s.email = "[email protected]"
s.homepage = "http://flori.github.com/#{PKG_NAME}"
s.license = 'Ruby'
s.required_ruby_version = '~>2.0'
#s.required_ruby_version = '~>2.0'
end

desc 'Creates a json.gemspec file'
Expand Down
2 changes: 1 addition & 1 deletion ext/json/ext/parser/parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -1608,7 +1608,7 @@ static VALUE convert_encoding(VALUE source)
FORCE_UTF8(source);
}
} else {
source = rb_str_conv_enc(source, NULL, rb_utf8_encoding());
source = rb_str_conv_enc(source, rb_enc_get(source), rb_utf8_encoding());
}
}
#else
Expand Down
2 changes: 1 addition & 1 deletion ext/json/ext/parser/parser.rl
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ static VALUE convert_encoding(VALUE source)
FORCE_UTF8(source);
}
} else {
source = rb_str_conv_enc(source, NULL, rb_utf8_encoding());
source = rb_str_conv_enc(source, rb_enc_get(source), rb_utf8_encoding());
}
}
#else
Expand Down
Binary file modified json.gemspec
Binary file not shown.
3 changes: 1 addition & 2 deletions json_pure.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,14 @@ Gem::Specification.new do |s|
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
s.require_paths = ["lib".freeze]
s.authors = ["Florian Frank".freeze]
s.date = "2017-01-11"
s.date = "2017-01-12"
s.description = "This is a JSON implementation in pure Ruby.".freeze
s.email = "[email protected]".freeze
s.extra_rdoc_files = ["README.md".freeze]
s.files = ["./tests/test_json.rb".freeze, "./tests/test_json_addition.rb".freeze, "./tests/test_json_encoding.rb".freeze, "./tests/test_json_fixtures.rb".freeze, "./tests/test_json_generate.rb".freeze, "./tests/test_json_generic_object.rb".freeze, "./tests/test_json_string_matching.rb".freeze, "./tests/test_json_unicode.rb".freeze, ".gitignore".freeze, ".travis.yml".freeze, "CHANGES".freeze, "Gemfile".freeze, "README-json-jruby.markdown".freeze, "README.md".freeze, "Rakefile".freeze, "TODO".freeze, "VERSION".freeze, "data/example.json".freeze, "data/index.html".freeze, "data/prototype.js".freeze, "diagrams/.keep".freeze, "ext/json/ext/fbuffer/fbuffer.h".freeze, "ext/json/ext/generator/depend".freeze, "ext/json/ext/generator/extconf.rb".freeze, "ext/json/ext/generator/generator.c".freeze, "ext/json/ext/generator/generator.h".freeze, "ext/json/ext/parser/depend".freeze, "ext/json/ext/parser/extconf.rb".freeze, "ext/json/ext/parser/parser.c".freeze, "ext/json/ext/parser/parser.h".freeze, "ext/json/ext/parser/parser.rl".freeze, "ext/json/extconf.rb".freeze, "install.rb".freeze, "java/src/json/ext/ByteListTranscoder.java".freeze, "java/src/json/ext/Generator.java".freeze, "java/src/json/ext/GeneratorMethods.java".freeze, "java/src/json/ext/GeneratorService.java".freeze, "java/src/json/ext/GeneratorState.java".freeze, "java/src/json/ext/OptionsReader.java".freeze, "java/src/json/ext/Parser.java".freeze, "java/src/json/ext/Parser.rl".freeze, "java/src/json/ext/ParserService.java".freeze, "java/src/json/ext/RuntimeInfo.java".freeze, "java/src/json/ext/StringDecoder.java".freeze, "java/src/json/ext/StringEncoder.java".freeze, "java/src/json/ext/Utils.java".freeze, "json-java.gemspec".freeze, "json.gemspec".freeze, "json_pure.gemspec".freeze, "lib/json.rb".freeze, "lib/json/add/bigdecimal.rb".freeze, "lib/json/add/complex.rb".freeze, "lib/json/add/core.rb".freeze, "lib/json/add/date.rb".freeze, "lib/json/add/date_time.rb".freeze, "lib/json/add/exception.rb".freeze, "lib/json/add/ostruct.rb".freeze, "lib/json/add/range.rb".freeze, "lib/json/add/rational.rb".freeze, "lib/json/add/regexp.rb".freeze, "lib/json/add/struct.rb".freeze, "lib/json/add/symbol.rb".freeze, "lib/json/add/time.rb".freeze, "lib/json/common.rb".freeze, "lib/json/ext.rb".freeze, "lib/json/ext/.keep".freeze, "lib/json/generic_object.rb".freeze, "lib/json/pure.rb".freeze, "lib/json/pure/generator.rb".freeze, "lib/json/pure/parser.rb".freeze, "lib/json/version.rb".freeze, "tests/fixtures/fail1.json".freeze, "tests/fixtures/fail10.json".freeze, "tests/fixtures/fail11.json".freeze, "tests/fixtures/fail12.json".freeze, "tests/fixtures/fail13.json".freeze, "tests/fixtures/fail14.json".freeze, "tests/fixtures/fail18.json".freeze, "tests/fixtures/fail19.json".freeze, "tests/fixtures/fail2.json".freeze, "tests/fixtures/fail20.json".freeze, "tests/fixtures/fail21.json".freeze, "tests/fixtures/fail22.json".freeze, "tests/fixtures/fail23.json".freeze, "tests/fixtures/fail24.json".freeze, "tests/fixtures/fail25.json".freeze, "tests/fixtures/fail27.json".freeze, "tests/fixtures/fail28.json".freeze, "tests/fixtures/fail3.json".freeze, "tests/fixtures/fail4.json".freeze, "tests/fixtures/fail5.json".freeze, "tests/fixtures/fail6.json".freeze, "tests/fixtures/fail7.json".freeze, "tests/fixtures/fail8.json".freeze, "tests/fixtures/fail9.json".freeze, "tests/fixtures/pass1.json".freeze, "tests/fixtures/pass15.json".freeze, "tests/fixtures/pass16.json".freeze, "tests/fixtures/pass17.json".freeze, "tests/fixtures/pass2.json".freeze, "tests/fixtures/pass26.json".freeze, "tests/fixtures/pass3.json".freeze, "tests/setup_variant.rb".freeze, "tests/test_json.rb".freeze, "tests/test_json_addition.rb".freeze, "tests/test_json_encoding.rb".freeze, "tests/test_json_fixtures.rb".freeze, "tests/test_json_generate.rb".freeze, "tests/test_json_generic_object.rb".freeze, "tests/test_json_string_matching.rb".freeze, "tests/test_json_unicode.rb".freeze, "tools/diff.sh".freeze, "tools/fuzz.rb".freeze, "tools/server.rb".freeze]
s.homepage = "http://flori.github.com/json".freeze
s.licenses = ["Ruby".freeze]
s.rdoc_options = ["--title".freeze, "JSON implemention for ruby".freeze, "--main".freeze, "README.md".freeze]
s.required_ruby_version = Gem::Requirement.new("~> 2.0".freeze)
s.rubygems_version = "2.6.8".freeze
s.summary = "JSON Implementation for Ruby".freeze
s.test_files = ["./tests/test_json.rb".freeze, "./tests/test_json_addition.rb".freeze, "./tests/test_json_encoding.rb".freeze, "./tests/test_json_fixtures.rb".freeze, "./tests/test_json_generate.rb".freeze, "./tests/test_json_generic_object.rb".freeze, "./tests/test_json_string_matching.rb".freeze, "./tests/test_json_unicode.rb".freeze]
Expand Down

0 comments on commit 7f05140

Please sign in to comment.