Commit d2724ef8 authored by Eric Davis's avatar Eric Davis

Brute force fix for Changeset#committer encoding on 1.9.2

parent 477a5f37
......@@ -74,6 +74,14 @@ class Changeset < ActiveRecord::Base
user || committer.to_s.split('<').first
end
# Committer of the Changeset
#
# Attribute reader for committer that encodes the committer string to
# the repository log encoding (e.g. UTF-8)
def committer
self.class.to_utf8(read_attribute(:committer), repository.repo_log_encoding)
end
def before_create
self.committer = self.class.to_utf8(self.committer, repository.repo_log_encoding)
self.comments = self.class.normalize_comments(self.comments, repository.repo_log_encoding)
......@@ -273,12 +281,6 @@ class Changeset < ActiveRecord::Base
end
str = txtar
end
# removes invalid UTF8 sequences
begin
Iconv.conv('UTF-8//IGNORE', 'UTF-8', str + ' ')[0..-3]
rescue Iconv::InvalidEncoding
# "UTF-8//IGNORE" is not supported on some OS
str
end
str
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment