openurl 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/openurl/context_object.rb +3 -3
- metadata +1 -1
@@ -302,13 +302,13 @@ module OpenURL
|
|
302
302
|
hash.each_pair do |key, values|
|
303
303
|
# get a list of all terminal values, whether wrapped
|
304
304
|
# in arrays or not. We're going to mutate them.
|
305
|
-
[values].flatten.each do | v |
|
305
|
+
[values].flatten.compact.each do | v |
|
306
306
|
v.force_encoding(source_encoding)
|
307
307
|
if source_encoding == "UTF-8"
|
308
|
-
ensure_valid_encoding!(v, :invalid => :replace
|
308
|
+
ensure_valid_encoding!(v, :invalid => :replace )
|
309
309
|
else
|
310
310
|
# transcode, replacing any bad chars.
|
311
|
-
v.encode!("UTF-8", :invalid => :replace)
|
311
|
+
v.encode!("UTF-8", :invalid => :replace, :undef => :replace )
|
312
312
|
end
|
313
313
|
end
|
314
314
|
end
|