require 'uri'

module Kernel

  def uri( s, w=%r{[^a-zA-Z_0-9./-]} )
    URI.escape( s, w )
  end

  def unuri( s )
    URI.unescape( s )
  end

end


#  _____         _
# |_   _|__  ___| |_
#   | |/ _ \/ __| __|
#   | |  __/\__ \ |_
#   |_|\___||___/\__|
#
=begin test

  require 'test/unit'

  class TCKernel < Test::Unit::TestCase

    def test_uri
      assert_equal( uri("abc?xyz"), "abc%3Fxyz" )
    end

    def test_unuri
      assert_equal( unuri("abc%3Fxyz"), "abc?xyz" )
    end

  end

=end
