Permalink
Browse files

fix invalid byte sequence error on Network Graph

  • Loading branch information...
1 parent ec66578 commit e3a2a830045866a44e1cc41404f75fc6df6aed85 @yudoufu committed May 23, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/graph_commit.rb
View
@@ -96,13 +96,13 @@ def to_graph_hash
h[:parents] = self.parents.collect do |p|
[p.id,0,0]
end
- h[:author] = author.name.force_encoding("UTF-8")
+ h[:author] = author.name.force_encoding("UTF-8").encode("UTF-16BE", :invalid => :replace, :undef => :replace, :replace => '?').encode("UTF-8")
h[:time] = time
h[:space] = space
h[:refs] = refs.collect{|r|r.name}.join(" ") unless refs.nil?
h[:id] = sha
h[:date] = date
- h[:message] = message.force_encoding("UTF-8")
+ h[:message] = message.force_encoding("UTF-8").encode("UTF-16BE", :invalid => :replace, :undef => :replace, :replace => '?').encode("UTF-8")
h[:login] = author.email
h
end

1 comment on commit e3a2a83

@zzjin
zzjin commented on e3a2a83 May 28, 2012

do not slove 500 problem...

Please sign in to comment.