Project

enco

0.0
No commit activity in last 3 years
No release in over 3 years
Enco can convert any string to utf-8, based on it original encoding. Converting string to utf-8 never was so simple as with Enco!
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
>= 2.6

Runtime

 Project Readme

Enco

Build Status Gemnasium Build Status

Enco will convert any string to utf-8, based on original string encoding.

Installation

gem install enco

Usage

It is simple. Just call

my_utf8_string = Enco.to_utf8 any_string

If you pass something other, than a string, it'll return non string objects back:

Enco.to_utf8(not_a_string) === not_a_string # true

Enco does not touch input string, so you may pass frozen strings to it and it'll handle them correctly.

frozen_string = "hi there!".frozen
Enco.to_utf8 frozen_string         # utf-8 analog of frozen_string

Plugins

Add

require 'enco/string_to_utf8'

and you'll get #to_utf-8 method on String objects:

"hi there!".to_utf8

It delegates to Enco.to_utf8 and accepts same options as

Enco.to_utf8 "hi there!"

Requirements

  • Ruby 1.9
  • rchardet19

Compatibility

tested with Ruby

  • 1.9.2
  • 1.9.3
  • jruby-19mode
  • rbx-19mode
  • ruby-head

see build history

Contributing

see contributing guide

Copyright

Copyright © 2011-2012 Alexander N Paramonov. Released under the MIT License. See the LICENSE file for further details.