# URI::Escape (Module)

In: | uri/common.rb

## Methods

decode encode escape unescape

## Included Modules

REGEXP

## Public Instance methods

escape(str, unsafe = UNSAFE)

[Source]

    # File uri/common.rb, line 248
        def escape(str, unsafe = UNSAFE)
          unless unsafe.kind_of?(Regexp)
            # perhaps unsafe is String object

            unsafe = Regexp.new(Regexp.quote(unsafe), false, 'N')
          end
          str.gsub(unsafe) do |us|
            tmp = ''
            us.each_byte do |uc|
              tmp << sprintf('%%%02X', uc)
            end
            tmp
          end
        end

encode(str, unsafe = UNSAFE)

Alias for escape

unescape(str)

[Source]

    # File uri/common.rb, line 263
        def unescape(str)
          str.gsub(ESCAPED) do
            $&[1,2].hex.chr
          end
        end

decode(str)

Alias for unescape

[Validate]