Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: rest-client/rest-client
...
head fork: cohuman/rest-client
compare: master
Checking mergeability… Don't worry, you can still create the pull request.
  • 1 commit
  • 4 files changed
  • 0 commit comments
  • 1 contributor
View
3  lib/restclient/response.rb
@@ -14,6 +14,9 @@ def body
def Response.create body, net_http_res, args
result = body || ''
+ if result.respond_to?(:force_encoding)
+ result.force_encoding("utf-8")
+ end
result.extend Response
result.net_http_res = net_http_res
result.args = args
View
2  rest-client.gemspec
@@ -5,7 +5,7 @@
Gem::Specification.new do |s|
s.name = %q{rest-client}
- s.version = "1.6.7"
+ s.version = "1.6.8"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = [%q{Adam Wiggins}, %q{Julien Kirch}]
View
2  spec/base.rb
@@ -5,7 +5,7 @@ def is_ruby_19?
Encoding.default_internal = Encoding.default_external = "ASCII-8BIT" if is_ruby_19?
require 'rubygems'
-require 'spec'
+require 'rspec'
begin
require "ruby-debug"
View
6 spec/response_spec.rb
@@ -16,6 +16,12 @@
@response.to_i.should == 200
end
+ it 'forces encoding to utf-8' do
+ response_string = 'abc'
+ response_string.should_receive(:force_encoding).with('utf-8')
+ RestClient::Response.create(response_string, @net_http_res, {})
+ end
+
it "accepts nil strings and sets it to empty for the case of HEAD" do
RestClient::Response.create(nil, @net_http_res, {}).should.to_s == ""
end

No commit comments for this range

Something went wrong with that request. Please try again.