lib/europeana/blacklight/response.rb in europeana-blacklight-1.0.0 vs lib/europeana/blacklight/response.rb in europeana-blacklight-1.1.0
- old
+ new
@@ -1,5 +1,7 @@
+# frozen_string_literal: true
+
module Europeana
module Blacklight
##
# Europeana API response for BL
class Response < HashWithIndifferentAccess
@@ -80,10 +82,10 @@
when Hash
value.each { |k, v| value[k] = force_to_utf8(v) }
when Array
value.each { |v| force_to_utf8(v) }
when String
- value.force_encoding('utf-8') if value.respond_to?(:force_encoding)
+ String.new(value).force_encoding('utf-8') if value.respond_to?(:force_encoding)
end
value
end
end
end