1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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:
naruse 2016-01-14 11:20:24 +00:00
parent 92e803c9c8
commit aa90e3b859
3 changed files with 8 additions and 1 deletions

View file

@ -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>
* variable.c (rb_f_global_variables): add matched back references

View file

@ -1341,7 +1341,7 @@ module URI
# Constructs String from URI
#
def to_s
str = String.new
str = ''.dup
if @scheme
str << @scheme
str << ':'

View file

@ -768,6 +768,7 @@ class URI::TestGeneric < Test::Unit::TestCase
def test_build
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(Encoding::UTF_8, u.to_s.encoding)
u = URI::Generic.build(:port => "5432")
assert_equal(":5432", u.to_s)