summaryrefslogtreecommitdiff
path: root/lib/gitlabhq/encode.rb
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2012-05-21 23:17:41 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2012-05-21 23:17:41 +0300
commit1b2068eaa91e5002d01a220c65da21dad8ccb071 (patch)
treefcfeafc2d1ad23aa3b5ae4e8d19b76c3cd2efcdc /lib/gitlabhq/encode.rb
parent09831488c9be082f424c774e8eecd3f002dbae37 (diff)
downloadgitlab-ce-1b2068eaa91e5002d01a220c65da21dad8ccb071.tar.gz
Gem updates & githost logger
* Grit gem updated * gitolite-client updated * logger added * few fixes
Diffstat (limited to 'lib/gitlabhq/encode.rb')
-rw-r--r--lib/gitlabhq/encode.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/gitlabhq/encode.rb b/lib/gitlabhq/encode.rb
index 11d9bd7bfd9..55e86192ad4 100644
--- a/lib/gitlabhq/encode.rb
+++ b/lib/gitlabhq/encode.rb
@@ -3,6 +3,8 @@ module Gitlabhq
extend self
def utf8 message
+ return nil unless message
+
hash = CharlockHolmes::EncodingDetector.detect(message) rescue {}
if hash[:encoding]
CharlockHolmes::Converter.convert(message, hash[:encoding], 'UTF-8')