stevefolder/vendor/bundle/ruby/3.1.0/gems/unf-0.1.4
2022-02-04 18:48:09 -05:00
..
lib init 2022-02-04 18:48:09 -05:00
test init 2022-02-04 18:48:09 -05:00
.gitignore init 2022-02-04 18:48:09 -05:00
.travis.yml init 2022-02-04 18:48:09 -05:00
CHANGELOG.md init 2022-02-04 18:48:09 -05:00
Gemfile init 2022-02-04 18:48:09 -05:00
LICENSE init 2022-02-04 18:48:09 -05:00
Rakefile init 2022-02-04 18:48:09 -05:00
README.md init 2022-02-04 18:48:09 -05:00
unf.gemspec init 2022-02-04 18:48:09 -05:00

ruby-unf

Synopsis

  • A wrapper library to bring Unicode Normalization Form support to Ruby/JRuby

Description

  • Uses unf_ext on CRuby and java.text.Normalizer on JRuby.

  • Normalizes UTF-8 strings into and from NFC, NFD, NFKC or NFKD

      # For bulk conversion
      normalizer = UNF::Normalizer.instance
      a_bunch_of_strings.map! { |string|
        normalizer.normalize(string, :nfc) #=> string in NFC
      }
    
      # Class method
      UNF::Normalizer.normalize(string, :nfc)
    
      # Instance methods of String
      string.to_nfc
    

Installation

gem install unf

License

Copyright (c) 2011, 2012, 2013 Akinori MUSHA

Licensed under the 2-clause BSD license. See LICENSE for details.