Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
O
OHR Support
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
97
Issues
97
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
OHR Support
Commits
d2724ef8
Commit
d2724ef8
authored
Jul 22, 2011
by
Eric Davis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Brute force fix for Changeset#committer encoding on 1.9.2
parent
477a5f37
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
7 deletions
+9
-7
changeset.rb
app/models/changeset.rb
+9
-7
No files found.
app/models/changeset.rb
View file @
d2724ef8
...
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment