Merge pull request #8 from moorchegue/master

Getting rid of iconv because of its deprecation.
This commit is contained in:
Reuben Mallaby 2013-08-12 04:44:00 -07:00
commit 9c968d14e1
1 changed files with 1 additions and 3 deletions

View File

@ -15,8 +15,6 @@
# along with this program; if not, write to the Free Software # along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
require 'iconv'
class DataFile < ActiveRecord::Base class DataFile < ActiveRecord::Base
def self.save(directory, zipname, upload) def self.save(directory, zipname, upload)
path = File.join(directory, zipname) path = File.join(directory, zipname)
@ -143,7 +141,7 @@ class RedmineEmbeddedController < ApplicationController
# Re-encode content if needed # Re-encode content if needed
source_encoding = Setting.plugin_redmine_embedded['encoding'].to_s source_encoding = Setting.plugin_redmine_embedded['encoding'].to_s
unless source_encoding.blank? unless source_encoding.blank?
begin; @content = Iconv.new('UTF-8', source_encoding).iconv(@content); rescue; end begin; @content = @content.encode("UTF-8", source_encoding); rescue; end
end end
@doc_template = Redmine::Plugins::RedmineEmbedded.detect_template_from_path(path) @doc_template = Redmine::Plugins::RedmineEmbedded.detect_template_from_path(path)