openurl 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- 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
|