table_print icon indicating copy to clipboard operation
table_print copied to clipboard

Invalid byte sequence in UTF-8

Open xslim opened this issue 11 years ago • 1 comments

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'

xslim avatar Dec 17 '13 13:12 xslim

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

xslim avatar Dec 17 '13 14:12 xslim