GithubHelp home page GithubHelp logo

idn-ruby's Introduction

LibIDN Ruby Bindings

Version 0.1.0

Ruby Bindings for the GNU LibIDN library, an implementation of the Stringprep, Punycode and IDNA specifications defined by the IETF Internationalized Domain Names (IDN) working group.

Included are the most important parts of the Stringprep, Punycode and IDNA APIs like performing Stringprep processings, encoding to and decoding from Punycode strings and converting entire domain names to and from the ACE encoded form.

The latest version of the LibIDN Ruby Bindings project and its documentation can always be found at

The original version can be found at,

See the CHANGES file for detailed information on the changes of every released version.

Requirements

  • GNU LibIDN Library

  • Rake to run the tests and generate the documentation

  • RubyGems to produce a Gem package

  • Ruby 1.9.1 or above. Patches welcome to make this work in 1.8.7

Installation

You can easily install the LibIDN Ruby Bindings by following one of the ways outlined below:

Automatic installation and management with RubyGems

Simply invoke the standard RubyGems commands (install, update, ...), for example:

gem install --remote --test idn

or if the GNU LibIDN library can only be found in a non-standard location

gem install --remote --test idn -- \
  --with-idn-dir=/path/to/non/standard/location

or in an even more complex setup

gem install --remote --test idn -- \
  --with-idn-lib=/path/to/non/standard/location/lib \
  --with-idn-include=/path/to/non/standard/location/include

Semi-automatic installation with Rake

If you are not able to or don't want to use RubyGems you can simply download the latest release and install it with the help of Rake:

tar -xvzf idn-x.x.x.tar.gz
cd idn-x.x.x

rake install

or if the GNU LibIDN library can only be found in a non-standard location

rake install IDN_DIR=/path/to/non/standard/location

You can also run the tests or generate the documentation; just call Rake with the '--tasks' parameter to get an overview of the available tasks:

rake --tasks

Manual installation with extconf.rb

If you are not able to or don't want to use even Rake then you will have to do a little bit more work by yourself:

tar -xvzf idn-x.x.x.tar.gz
cd idn-x.x.x/ext

ruby extconf.rb

or if the GNU LibIDN library can only be found in a non-standard location

ruby extconf.rb \
  --with-idn-dir=/path/to/non/standard/location

or in an even more complex setup

ruby extconf.rb \
  --with-idn-lib=/path/to/non/standard/location/lib \
  --with-idn-include=/path/to/non/standard/location/include

and finally

make
sudo make install

Documentation

The complete documentation is available online at

Example usage

require 'idn'
include IDN

puts 'Idna.toUnicode: ' + Idna.toUnicode('xn--rksmrgs-5wao1o.josefsson.org')
puts 'Punycode.decode: ' + Punycode.decode('egbpdaj6bu4bxfgehfvwxn')
puts 'Stringprep.with_profile: ' + Stringprep.with_profile('FOO', 'Nameprep')

References

[GNU LibIDN] An implementation of the Stringprep, Punycode and IDNA specifications defined by the IETF Internationalized Domain Names (IDN) working group, used for internationalized domain names. The package is available under the GNU Lesser General Public License.

[RFC3454] P. Hoffman, M. Blanchet, "Preparation of Internationalized Strings ('stringprep')", IETF RFC3454, December 2002.

[RFC3490] P. Faltstrom, P. Hoffman, A. Costello, "Internationalizing Domain Names in Applications (IDNA)", IETF RFC3490, March 2003.

[RFC3491] P. Hoffman, M. Blanchet, "Nameprep: A Stringprep Profile for Internationalized Domain Names (IDN)", IETF RFC3491, March 2003.

[RFC3492] A. Costello, "Punycode: A Bootstring encoding of Unicode for Internationalized Domain Names in Applications (IDNA)", IETF RFC3492, March 2003.

Questions, comments, patches?

If you have any questions, comments or feature requests or if you want to submit a bug report or provide a patch, then have a look at the project website at

For other information, feel free to ask on the idn-discuss at rubyforge.org mailing list.

Copyright & License

Copyright (c) 2005-2006 Erik Abele. 2011 Bharanee Rathna. All rights reserved.

This documentation and the software itself are licensed under the Apache License, Version 2.0 (the "License").

Some portions of the software come with separate copyright notices and are subject to additional license terms. Please see the file called LICENSE for further details on these subcomponents of the software.

You may also obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

This software is OSI Certified Open Source Software. OSI Certified is a certification mark of the Open Source Initiative.

idn-ruby's People

Contributors

deepfryed avatar dmytrostepaniuk avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.