@@ -260,6 +260,15 module Redmine | |||
|
260 | 260 | def scm_iconv(to, from, str) |
|
261 | 261 | return nil if str.nil? |
|
262 | 262 | return str if to == from |
|
263 | if str.respond_to?(:force_encoding) | |
|
264 | str.force_encoding(from) | |
|
265 | begin | |
|
266 | s = str.encode(to) | |
|
267 | rescue Exception => e | |
|
268 | logger.error("failed to convert from #{from} to #{to}. #{err}") | |
|
269 | nil | |
|
270 | end | |
|
271 | else | |
|
263 | 272 | begin |
|
264 | 273 | Iconv.conv(to, from, str) |
|
265 | 274 | rescue Iconv::Failure => err |
@@ -267,6 +276,7 module Redmine | |||
|
267 | 276 | nil |
|
268 | 277 | end |
|
269 | 278 | end |
|
279 | end | |
|
270 | 280 | |
|
271 | 281 | def parse_xml(xml) |
|
272 | 282 | if RUBY_PLATFORM == 'java' |
General Comments 0
You need to be logged in to leave comments.
Login now