diff --git a/app/models/changeset.rb b/app/models/changeset.rb index 4f6300381..7e369ed35 100644 --- a/app/models/changeset.rb +++ b/app/models/changeset.rb @@ -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