]> source.dussan.org Git - redmine.git/commitdiff
Merged r3635 from trunk.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 11 Apr 2010 14:53:54 +0000 (14:53 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 11 Apr 2010 14:53:54 +0000 (14:53 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/0.9-stable@3657 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/changeset.rb

index 4f6300381d943f83c7059a8763f15aa64f29e215..7e369ed3549402d6f261f71d297ec4dd104d4798 100644 (file)
@@ -182,6 +182,11 @@ class Changeset < ActiveRecord::Base
       end
     end
     # removes invalid UTF8 sequences
-    Iconv.conv('UTF-8//IGNORE', 'UTF-8', str + '  ')[0..-3]
+    begin
+      Iconv.conv('UTF-8//IGNORE', 'UTF-8', str + '  ')[0..-3]
+    rescue Iconv::InvalidEncoding
+      # "UTF-8//IGNORE" is not supported on some OS
+      str
+    end
   end
 end