table_print
table_print copied to clipboard
Invalid byte sequence in UTF-8
While trying to print array of hashes which includes UTF-8 symbols
ArgumentError: invalid byte sequence in UTF-8
from /Users/slim/.rvm/gems/ruby-1.9.3-p194/gems/table_print-1.5.1/lib/table_print/formatter.rb:16:in `gsub'
Can be fixed putting
encode('UTF-8', 'binary', invalid: :replace, undef: :replace, replace: '')
before gsub
in https://github.com/arches/table_print/blob/master/lib/table_print/formatter.rb#L16