diff --git a/CHANGELOG.md b/CHANGELOG.md index aa59626..e003748 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ### Unreleased +* Remove `iconv` conditional require + ### Version v1.19.1 * Fix error when parsing values consisting of `!important` only diff --git a/lib/css_parser.rb b/lib/css_parser.rb index b50f81b..2fbbd20 100644 --- a/lib/css_parser.rb +++ b/lib/css_parser.rb @@ -6,7 +6,6 @@ require 'digest/md5' require 'zlib' require 'stringio' -require 'iconv' unless String.method_defined?(:encode) require 'css_parser/version' require 'css_parser/rule_set' diff --git a/lib/css_parser/parser.rb b/lib/css_parser/parser.rb index 11dd36f..e199e3b 100644 --- a/lib/css_parser/parser.rb +++ b/lib/css_parser/parser.rb @@ -677,12 +677,7 @@ def read_remote_file(uri) # :nodoc: end if charset - if String.method_defined?(:encode) - src.encode!('UTF-8', charset) - else - ic = Iconv.new('UTF-8//IGNORE', charset) - src = ic.iconv(src) - end + src.encode!('UTF-8', charset) end rescue @redirect_count = nil