@@ -104,8 +104,10 module Redmine | |||
|
104 | 104 | encodings.each do |encoding| |
|
105 | 105 | if str.respond_to?(:force_encoding) |
|
106 | 106 | str.force_encoding(encoding) |
|
107 | if str.valid_encoding? | |
|
107 | begin | |
|
108 | 108 | return str.encode('UTF-8') |
|
109 | rescue Encoding::InvalidByteSequenceError | |
|
110 | # do nothing here and try the next encoding | |
|
109 | 111 | end |
|
110 | 112 | else |
|
111 | 113 | begin |
General Comments 0
You need to be logged in to leave comments.
Login now