mirror of
https://github.com/redmine/redmine.git
synced 2026-05-07 21:57:30 +02:00
scm: to_utf8() in repositories_helper always returns UTF-8 in Ruby 1.9.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5165 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -69,5 +69,21 @@ class RepositoryHelperTest < HelperTestCase
|
||||
assert_equal "", to_utf8("")
|
||||
assert_equal nil, to_utf8(nil)
|
||||
end
|
||||
end
|
||||
|
||||
def test_to_utf8_returns_ascii_as_utf8
|
||||
s1 = "ASCII"
|
||||
s2 = s1.dup
|
||||
if s1.respond_to?(:force_encoding)
|
||||
s1.force_encoding("UTF-8")
|
||||
s2.force_encoding("ISO-8859-1")
|
||||
end
|
||||
str1 = to_utf8(s1)
|
||||
str2 = to_utf8(s2)
|
||||
assert_equal s1, str1
|
||||
assert_equal s1, str2
|
||||
if s1.respond_to?(:force_encoding)
|
||||
assert_equal "UTF-8", str1.encoding.to_s
|
||||
assert_equal "UTF-8", str2.encoding.to_s
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user