X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=lib%2Fsup%2Futil.rb;h=068ce6bad904c9012bdcd5d8883ac48a68e59976;hb=bf30feea5c29d1aa5c1b8bbefa2bf4f4e73b1510;hp=518866beff61e308319ccde80042cdb9c442d8a0;hpb=ed7ec99d5a1c42c53ad94c81832a7ba73b14fadc;p=sup diff --git a/lib/sup/util.rb b/lib/sup/util.rb index 518866b..068ce6b 100644 --- a/lib/sup/util.rb +++ b/lib/sup/util.rb @@ -92,7 +92,7 @@ end class Range ## only valid for integer ranges (unless I guess it's exclusive) - def size + def size last - first + (exclude_end? ? 0 : 1) end end @@ -654,7 +654,7 @@ class Iconv begin Iconv.iconv(target + "//IGNORE", charset, text + " ").join[0 .. -2] rescue Errno::EINVAL, Iconv::InvalidEncoding, Iconv::InvalidCharacter, Iconv::IllegalSequence => e - info "couldn't transcode text from #{charset} to #{target} (\"#{text[0 ... 20]}\"...)" + warn "couldn't transcode text from #{charset} to #{target} (\"#{text[0 ... 20]}\"...) (got #{e.message}); using original as is" text end end