Sha256: 87125a84a733dc04535077c9ceddfbf4fd31ddd3fae58e87773a488d7a2fbdc2
Contents?: true
Size: 574 Bytes
Versions: 13
Compression:
Stored size: 574 Bytes
Contents
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['ä', '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
13 entries across 13 versions & 2 rubygems