Url Encode Url Decode
More Tools
Other tools: Base64 Decode | Base64 Image Decoder | Base64 Encode | Base64 Image Encoder

Ruby url_encode

Escapes/Encodes the string, replacing all unsafe characters with codes.

Function

url_encode ( str )

Alias Function

u ( s )

Parameters

str - String to be encoded.

Return value

Returns escaped/encoded version of str

Example
require 'erb'
include ERB::Util

url = url_encode("http://example.com/?a=ruby url encode")
puts url
Output
http%3A%2F%2Fexample.com%2F%3Fa%3Druby%20url%20encode