Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid byte sequence in UTF-8 #49

Open
xslim opened this issue Dec 17, 2013 · 1 comment
Open

Invalid byte sequence in UTF-8 #49

xslim opened this issue Dec 17, 2013 · 1 comment

Comments

@xslim
Copy link
Contributor

xslim commented Dec 17, 2013

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
Copy link
Contributor Author

xslim commented Dec 17, 2013

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant