lib/roo/excel.rb in roo-1.2.2 vs lib/roo/excel.rb in roo-1.2.3
- old
+ new
@@ -89,11 +89,15 @@
row,col = normalize(row,col)
if celltype(row,col,sheet) == :date
yyyy,mm,dd = @cell[sheet][[row,col]].split('-')
return Date.new(yyyy.to_i,mm.to_i,dd.to_i)
end
- return @cell[sheet][[row,col]]
+ if celltype(row,col,sheet) == :string
+ return platform_specific_iconv(@cell[sheet][[row,col]])
+ else
+ return @cell[sheet][[row,col]]
+ end
end
# returns the type of a cell:
# * :float
# * :string,
@@ -263,9 +267,10 @@
result
end
def every_second_null?(str)
result = true
+ return false if str.length < 2
0.upto(str.length/2-1) do |i|
c = str[i*2,1]
n = str[i*2+1,1]
if n != "\000"
result = false