lib/writeexcel/helper.rb in writeexcel-0.6.4 vs lib/writeexcel/helper.rb in writeexcel-0.6.5

- old
+ new

@@ -64,5 +64,12 @@ expn += 1 end col end private :chars_to_col + + NonAscii = /[^!"#\$%&'\(\)\*\+,\-\.\/\:\;<=>\?@0-9A-Za-z_\[\\\]\{\}^` ~\0\n]/ + + def is_utf8?(str) + ruby_18 { str =~ NonAscii } || + ruby_19 { str.encoding == Encoding::UTF_8 } + end