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