Sha256: bdbbf2847b64afdba4c71535fc2a6fd4883c1d6c228fdf23594b9c5b975f9306

Contents?: true

Size: 396 Bytes

Versions: 5

Compression:

Stored size: 396 Bytes

Contents

require 'abstract_unit'
require 'uri'

class URIExtTest < Test::Unit::TestCase
  def test_uri_decode_handle_multibyte
    str = "\xE6\x97\xA5\xE6\x9C\xAC\xE8\xAA\x9E" # Ni-ho-nn-go in UTF-8, means Japanese.
    str.force_encoding(Encoding::UTF_8) if str.respond_to?(:force_encoding)

    assert_equal str, URI.unescape(URI.escape(str))
    assert_equal str, URI.decode(URI.escape(str))
  end
end

Version data entries

5 entries across 5 versions & 3 rubygems

Version Path
kajam-1.0.3.rc2 vendor/rails/activesupport/test/core_ext/uri_ext_test.rb
radiant-1.0.0.rc2 vendor/rails/activesupport/test/core_ext/uri_ext_test.rb
radiant-1.0.0.rc1 vendor/rails/activesupport/test/core_ext/uri_ext_test.rb
radiant-0.9.0.rc2 vendor/rails/activesupport/test/core_ext/uri_ext_test.rb
usher-0.7.0 spec/rails2_3/vendor/rails/vendor/rails/activesupport/test/core_ext/uri_ext_test.rb