* lib/uri/generic.rb (URI::Generic#to_s): change encoding to
UTF-8 as Ruby 2.2/ by Koichi ITO <koic.ito@gmail.com> https://github.com/ruby/ruby/pull/1188 fix GH-1188 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53535 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
92e803c9c8
commit
aa90e3b859
@ -1,3 +1,9 @@
|
|||||||
|
Thu Jan 14 20:01:00 2016 NARUSE, Yui <naruse@ruby-lang.org>
|
||||||
|
|
||||||
|
* lib/uri/generic.rb (URI::Generic#to_s): change encoding to
|
||||||
|
UTF-8 as Ruby 2.2/ by Koichi ITO <koic.ito@gmail.com>
|
||||||
|
https://github.com/ruby/ruby/pull/1188 fix GH-1188
|
||||||
|
|
||||||
Thu Jan 14 17:36:16 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Thu Jan 14 17:36:16 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* variable.c (rb_f_global_variables): add matched back references
|
* variable.c (rb_f_global_variables): add matched back references
|
||||||
|
@ -1341,7 +1341,7 @@ module URI
|
|||||||
# Constructs String from URI
|
# Constructs String from URI
|
||||||
#
|
#
|
||||||
def to_s
|
def to_s
|
||||||
str = String.new
|
str = ''.dup
|
||||||
if @scheme
|
if @scheme
|
||||||
str << @scheme
|
str << @scheme
|
||||||
str << ':'
|
str << ':'
|
||||||
|
@ -768,6 +768,7 @@ class URI::TestGeneric < Test::Unit::TestCase
|
|||||||
def test_build
|
def test_build
|
||||||
u = URI::Generic.build(['http', nil, 'example.com', 80, nil, '/foo', nil, nil, nil])
|
u = URI::Generic.build(['http', nil, 'example.com', 80, nil, '/foo', nil, nil, nil])
|
||||||
assert_equal('http://example.com:80/foo', u.to_s)
|
assert_equal('http://example.com:80/foo', u.to_s)
|
||||||
|
assert_equal(Encoding::UTF_8, u.to_s.encoding)
|
||||||
|
|
||||||
u = URI::Generic.build(:port => "5432")
|
u = URI::Generic.build(:port => "5432")
|
||||||
assert_equal(":5432", u.to_s)
|
assert_equal(":5432", u.to_s)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user