Skip to content

Commit 5e8af45

Browse files
committed
add empty line after guard clause to lib/redmine/codeset_util.rb
git-svn-id: http://svn.redmine.org/redmine/trunk@20045 e93f8b46-1217-0410-a6f0-8f06a7374b81
1 parent b267f7e commit 5e8af45

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/redmine/codeset_util.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ module CodesetUtil
55

66
def self.replace_invalid_utf8(str)
77
return nil if str.nil?
8+
89
str = str.dup
910
str.force_encoding('UTF-8')
1011
if ! str.valid_encoding?
@@ -16,6 +17,7 @@ def self.replace_invalid_utf8(str)
1617

1718
def self.to_utf8(str, encoding)
1819
return if str.nil?
20+
1921
str = str.b
2022
if str.empty?
2123
str.force_encoding("UTF-8")
@@ -34,15 +36,18 @@ def self.to_utf8(str, encoding)
3436

3537
def self.to_utf8_by_setting(str)
3638
return if str.nil?
39+
3740
str = str.dup
3841
self.to_utf8_by_setting_internal(str).force_encoding('UTF-8')
3942
end
4043

4144
def self.to_utf8_by_setting_internal(str)
4245
return if str.nil?
46+
4347
str = str.b
4448
return str if str.empty?
4549
return str if /\A[\r\n\t\x20-\x7e]*\Z/n.match?(str) # for us-ascii
50+
4651
str.force_encoding('UTF-8')
4752
encodings = Setting.repositories_encodings.split(',').collect(&:strip)
4853
encodings.each do |encoding|
@@ -59,6 +64,7 @@ def self.to_utf8_by_setting_internal(str)
5964

6065
def self.from_utf8(str, encoding)
6166
return if str.nil?
67+
6268
str = str.dup
6369
str ||= ''
6470
str.force_encoding('UTF-8')

0 commit comments

Comments
 (0)