From f03e338880e905e5167a97102e0faa2fcbae399c Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Mon, 28 Feb 2011 08:03:43 +0000 Subject: [PATCH] scm: return if str.blank? in to_utf8(str). git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4960 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/helpers/repositories_helper.rb | 1 + app/models/changeset.rb | 1 + 2 files changed, 2 insertions(+) diff --git a/app/helpers/repositories_helper.rb b/app/helpers/repositories_helper.rb index 074dfa41a..f19d993ff 100644 --- a/app/helpers/repositories_helper.rb +++ b/app/helpers/repositories_helper.rb @@ -117,6 +117,7 @@ module RepositoriesHelper end def to_utf8(str) + return str if str.blank? if str.respond_to?(:force_encoding) str.force_encoding('UTF-8') else diff --git a/app/models/changeset.rb b/app/models/changeset.rb index 0a6081393..5e1ee19ba 100644 --- a/app/models/changeset.rb +++ b/app/models/changeset.rb @@ -247,6 +247,7 @@ class Changeset < ActiveRecord::Base end def self.to_utf8(str) + return str if str.blank? encoding = Setting.commit_logs_encoding.to_s.strip unless encoding.blank? || encoding == 'UTF-8' begin