Sha256: 0e37d7d0f8bc177003712c5f0a590028173f5e10564a93e9b9497a4242fc358d

Contents?: true

Size: 552 Bytes

Versions: 36

Compression:

Stored size: 552 Bytes

Contents

# coding: utf-8

module BibTeX
  begin
    original_verbosity, $VERBOSE = $VERBOSE, nil

    require 'iconv'

    @iconv = Iconv.new('ascii//translit//ignore', 'utf-8')

    def self.transliterate(str)
      @iconv.iconv(str)
    end
  rescue LoadError

    @iconv_replacements = Hash[*%w(ä ae ö oe ü ue Ä Ae Ö Oe Ü Ue ß ss)]

    # Returns +str+ transliterated containing only ASCII characters.
    def self.transliterate(str)
      str.gsub(/[äöüÄÖÜß]/, @iconv_replacements)
    end
  ensure
    $VERBOSE = original_verbosity
  end
end

Version data entries

36 entries across 36 versions & 2 rubygems

Version Path
bibtex-ruby-4.4.7 lib/bibtex/compatibility.rb
bibtex-ruby-4.4.6 lib/bibtex/compatibility.rb
bibtex-ruby-4.4.5 lib/bibtex/compatibility.rb
bibtex_to_scrapbox-0.2.0 gems/gems/bibtex-ruby-4.4.4/lib/bibtex/compatibility.rb
bibtex_to_scrapbox-0.1.0 gems/gems/bibtex-ruby-4.4.4/lib/bibtex/compatibility.rb
bibtex-ruby-4.4.4 lib/bibtex/compatibility.rb
bibtex-ruby-4.4.3 lib/bibtex/compatibility.rb
bibtex-ruby-4.4.2 lib/bibtex/compatibility.rb
bibtex-ruby-4.4.1 lib/bibtex/compatibility.rb
bibtex-ruby-4.4.0 lib/bibtex/compatibility.rb
bibtex-ruby-4.3.0 lib/bibtex/compatibility.rb
bibtex-ruby-4.2.0 lib/bibtex/compatibility.rb
bibtex-ruby-4.1.2 lib/bibtex/compatibility.rb
bibtex-ruby-4.1.1 lib/bibtex/compatibility.rb
bibtex-ruby-4.1.0 lib/bibtex/compatibility.rb
bibtex-ruby-4.0.16 lib/bibtex/compatibility.rb
bibtex-ruby-4.0.15 lib/bibtex/compatibility.rb
bibtex-ruby-4.0.14 lib/bibtex/compatibility.rb
bibtex-ruby-4.0.13 lib/bibtex/compatibility.rb
bibtex-ruby-4.0.12 lib/bibtex/compatibility.rb