git-svn-id: http://svn.redmine.org/redmine/branches/2.6-stable@13817
e93f8b46-1217-0410-a6f0-
8f06a7374b81
languages_options :cache => false
end
end
- options.map {|name, lang| [name.force_encoding("UTF-8"), lang.force_encoding("UTF-8")]}
+ options.map do |name, lang|
+ n = name
+ l = lang
+ n.force_encoding("UTF-8") if n.respond_to?(:force_encoding)
+ l.force_encoding("UTF-8") if l.respond_to?(:force_encoding)
+ [n, l]
+ end
end
def find_language(lang)
end
def test_languages_options_should_return_strings_with_utf8_encoding
- strings = languages_options.flatten
- assert_equal ["UTF-8"], strings.map(&:encoding).uniq.map(&:name).sort
+ if "".respond_to?(:force_encoding)
+ strings = languages_options.flatten
+ assert_equal ["UTF-8"], strings.map(&:encoding).uniq.map(&:name).sort
+ end
end
def test_languages_options_should_ignore_locales_without_general_lang_name_key