summaryrefslogtreecommitdiff
path: root/app/models/commit.rb
diff options
context:
space:
mode:
authorSaito <saitowu@gmail.com>2011-11-28 17:46:41 +0800
committerSaito <saitowu@gmail.com>2011-11-28 17:46:41 +0800
commit46cbe5418947ab58c919432b9013252ada6a3bc3 (patch)
tree1c2ae343e97d0fa93f7c8e1ded4ab64f04ce6233 /app/models/commit.rb
parent75fa0632e67b2b91401673b0dd292db4103224c8 (diff)
downloadgitlab-ce-46cbe5418947ab58c919432b9013252ada6a3bc3.tar.gz
fix the issue on github #157.
directly force_encoding is wrong, must detect the file string's encoding. then force_encoding the string to it's encoding. last convert it to utf-8.
Diffstat (limited to 'app/models/commit.rb')
-rw-r--r--app/models/commit.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/app/models/commit.rb b/app/models/commit.rb
index 6d724bc825d..0884e34225c 100644
--- a/app/models/commit.rb
+++ b/app/models/commit.rb
@@ -1,4 +1,6 @@
class Commit
+ include Utils::CharEncode
+
attr_accessor :commit
attr_accessor :head
@@ -20,7 +22,7 @@ class Commit
end
def safe_message
- message.force_encoding(Encoding::UTF_8)
+ encode(message)
end
def created_at
@@ -28,10 +30,10 @@ class Commit
end
def author_email
- author.email.force_encoding(Encoding::UTF_8)
+ encode(author.email)
end
def author_name
- author.name.force_encoding(Encoding::UTF_8)
+ encode(author.name)
end
end