Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
f615c877
Commit
f615c877
authored
Dec 13, 2011
by
Saito
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix can not guess problem
parent
822c0a50
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
3 deletions
+3
-3
app/helpers/application_helper.rb
app/helpers/application_helper.rb
+1
-0
app/helpers/commits_helper.rb
app/helpers/commits_helper.rb
+0
-2
lib/utils.rb
lib/utils.rb
+2
-1
No files found.
app/helpers/application_helper.rb
View file @
f615c877
require
'digest/md5'
module
ApplicationHelper
include
Utils
::
CharEncode
def
gravatar_icon
(
user_email
)
gravatar_host
=
request
.
ssl?
?
"https://secure.gravatar.com"
:
"http://www.gravatar.com"
...
...
app/helpers/commits_helper.rb
View file @
f615c877
module
CommitsHelper
include
Utils
::
CharEncode
def
old_line_number
(
line
,
i
)
end
...
...
lib/utils.rb
View file @
f615c877
...
...
@@ -18,13 +18,14 @@ module Utils
module
CharEncode
def
encode
(
string
)
return
''
unless
string
cd
=
CharDet
.
detect
(
string
)
if
cd
.
confidence
>
0.6
string
.
force_encoding
(
cd
.
encoding
)
end
string
.
encode
(
"utf-8"
,
:undef
=>
:replace
,
:replace
=>
"?"
,
:invalid
=>
:replace
)
rescue
"Invalid
code e
ncoding"
"Invalid
E
ncoding"
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