0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
Simple utility for URI encoding.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.6
>= 0
>= 0
 Project Readme

UriEncoding

Gem Version Build Status Coverage Status

Simple utility for URI encoding(URL encoding, percent encoding).

Installation

Add this line to your application's Gemfile:

gem 'uri_encoding'

And then execute:

$ bundle

Or install it yourself as:

$ gem install uri_encoding

Usage

Basic

UriEncoding.encode("Aa1!?_%") #=> "Aa1!?_%25"
UriEncoding.decode("Aa1!?_%25") #=> "Aa1!?_%"

Optional

UriEncoding.encode receives exceptions for encoding.

UriEncoding.encode("Aa1!?_%", []) #=> "%41%61%31%21%3F%5F%25"
UriEncoding.encode("Aa1!?_%", UriEncoding::UnreservedCharacters) #=> "Aa1%21%3F_%25"

UriEncoding.decode receives decoded string encoding.

string = UriEncoding.decode("%82%A0%82%A2%82%A4", Encoding::Windows_31J) #=> "あいう"
string.encoding #=> #<Encoding:Windows-31J>

Contributing

  1. Fork it ( https://github.com/[my-github-username]/uri_encoding/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request