SixArm.com » Ruby » Unaccent replaces a string's accented characters with ASCII characters.
Ruby
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.yardoc
coverage
doc
lib Improve quality assurance Jul 19, 2015
test
.codeclimate.yml
.document
.gemtest add .gemtest empty file for rubyget-test gem Feb 6, 2011
.gitattributes
.gitignore
.rspec
.travis.yml
CHANGES.md
CONTRIBUTING.md
Gemfile Improve quality assurance Jul 19, 2015
Gemfile.lock
LICENSE.md
README.md
Rakefile
VERSION
sixarm_ruby_unaccent-1.1.1-sha512.txt Improve quality assurance Jul 19, 2015
sixarm_ruby_unaccent-1.1.1.gem Improve quality assurance Jul 19, 2015
sixarm_ruby_unaccent.gemspec

README.md

SixArm.com » Ruby »
Unaccent gem

Gem Version Build Status Code Climate Coverage Status

Introduction

Replace a string's accent characters with ASCII characters.

Based on Perl Text::Unaccent from CPAN.

For docs go to http://sixarm.com/sixarm_ruby_unaccent/doc

Want to help? We're happy to get pull requests.

Install

To install using a Gemfile, add this:

gem "sixarm_ruby_unaccent", ">= 1.1.1", "< 2"

To install using the command line, run this:

gem install sixarm_ruby_unaccent -v ">= 1.1.1, < 2"

To install using the command line with high security, run this:

wget http://sixarm.com/sixarm.pem
gem cert --add sixarm.pem && gem sources --add http://sixarm.com
gem install sixarm_ruby_unaccent -v ">= 1.1.1, < 2" --trust-policy HighSecurity

To require the gem in your code:

require "sixarm_ruby_unaccent"

Examples

French:

require "sixarm_ruby_unaccent"
str = "déjà vu";
str.unaccent => "deja vu";

Greek:

require "sixarm_ruby_unaccent"
str = "νέα" (aka "\x{03AD}\x{03BD}\x{03B1}")
str.unaccent => "νεα" (aka "\x{03B5}\x{03BD}\x{03B1}")