Go to file
Jari Bakken 0160ebc344 Bundler + RSpec 2 2011-05-27 16:49:47 +02:00
benchmark Yet another rename (more consistent with other FFI projects) 2010-05-10 20:28:20 +02:00
lib Bundler + RSpec 2 2011-05-27 16:49:47 +02:00
spec Bundler + RSpec 2 2011-05-27 16:49:47 +02:00
.document Initial commit to icu-chardet-ffi. 2010-05-09 19:04:44 +02:00
.gitignore Bundler + RSpec 2 2011-05-27 16:49:47 +02:00
Gemfile Bundler + RSpec 2 2011-05-27 16:49:47 +02:00
LICENSE Update year in copyright (also fixed year in LICENSE) 2011-01-10 01:34:38 +01:00
README.rdoc Update year in copyright (also fixed year in LICENSE) 2011-01-10 01:34:38 +01:00
Rakefile Bundler + RSpec 2 2011-05-27 16:49:47 +02:00
VERSION Version bump to 0.0.2 2010-05-29 02:33:43 +02:00
ffi-icu.gemspec Bundler + RSpec 2 2011-05-27 16:49:47 +02:00
test.c Fix failing transliteration spec 2010-05-29 01:44:12 +02:00

README.rdoc

= ffi-icu

Simple FFI wrappers for things I need from ICU. For the full thing, check out ICU4R instead.

= Gem

* http://rubygems.org/gems/ffi-icu

  gem install ffi-icu

= Dependencies

ICU. If you get messages that the library or functions are not found, you can
set some environment varibles to tell ffi-icu where to find it, i.e.:

  FFI_ICU_LIB="icui18n.so" FFI_ICU_VERSION_SUFFIX="_3_8" ruby -r ffi-icu

= Features

== Character Encoding Detection

=== Examples:

  match = ICU::CharDet.detect(str)
  match.name       # => "UTF-8"
  match.confidence # => 80

or

  detector = ICU::CharDet::Detector.new
  detector.detect(str)
  detector.close

=== Why not just use rchardet?

* this is faster
* rchardet does not work well on 1.9
* none of the rchardet forks claiming to work on 1.9 actually does

== Locale Sensitive Collation

=== Examples:

  ICU::Collation.collate("nb", %w[å æ ø]) == %w[æ ø å] #=> true

or

  collator = ICU::Collation::Collator.new("nb")
  collator.compare("a", "b")  #=> -1
  collator.greater?("z", "a") #=> true
  collator.collate(%w[å æ ø]) #=> ["æ", "ø", "å"]

= Tested on:

Platforms:

* OS X 10.6
* Debian Linux
* Arch Linux

Rubies:

* MRI 1.9.1
* MRI 1.8.7

= TODO:

* Useful ICU stuff:
  - number formatting (decimal points, thousand separators, currency)
  - date formatting
* Windows?!

== Note on Patches/Pull Requests

* Fork the project.
* Make your feature addition or bug fix.
* Add tests for it. This is important so I don't break it in a
  future version unintentionally.
* Commit, do not mess with rakefile, version, or history.
  (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
* Send me a pull request. Bonus points for topic branches.

== Copyright

Copyright (c) 2010-2011 Jari Bakken. See LICENSE for details.