lib/iso639.rb in iso639-1.3.0 vs lib/iso639.rb in iso639-1.3.1
- old
+ new
@@ -34,10 +34,10 @@
LanguagesByAlpha3Terminology = InsensitiveHash.new
LanguagesByEnglishName = LanguagesByName = InsensitiveHash.new
LanguagesByFrenchName = InsensitiveHash.new
iso639_file = File.expand_path(File.join("..", "iso639", "ISO-639-2_utf-8.txt"), __FILE__)
- File.readlines(iso639_file).each do |line|
+ File.readlines(iso639_file, encoding: "utf-8").each do |line|
lang = Language.new *line.split("|")
LanguagesByAlpha2[lang.alpha2] = lang if lang.alpha2
LanguagesByAlpha3[lang.alpha3] = lang if lang.alpha3
LanguagesByAlpha3Terminology[lang.alpha3_terminology] = lang if lang.alpha3_terminology
lang.english_names.each { |name| LanguagesByName[name] = lang }