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

Replace non unicode characters to avoid crashes #131

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lacostej
Copy link

@lacostej lacostej commented Feb 8, 2024

This was encountered in fastlane/fastlane#21852

Without this, Terminal::Table.new can crash with

..............F.......................................

Failures:

  1) Terminal::Table should replace illegal unicode characters
     Failure/Error: @value.to_s.split(/\n/)
     
     ArgumentError:
       invalid byte sequence in UTF-8
     # ./lib/terminal-table/cell.rb:51:in `split'
     # ./lib/terminal-table/cell.rb:51:in `lines'
     # ./lib/terminal-table/cell.rb:71:in `value_for_column_width_recalc'
     # ./lib/terminal-table/table.rb:233:in `block (2 levels) in recalc_column_widths'
     # ./lib/terminal-table/table.rb:232:in `each'
     # ./lib/terminal-table/table.rb:232:in `block in recalc_column_widths'
     # ./lib/terminal-table/table.rb:230:in `each'
     # ./lib/terminal-table/table.rb:230:in `recalc_column_widths'
     # ./lib/terminal-table/table.rb:368:in `column_widths'
     # ./lib/terminal-table/table.rb:97:in `column_width'
     # ./lib/terminal-table/separator.rb:33:in `block in render'
     # ./lib/terminal-table/separator.rb:32:in `each'
     # ./lib/terminal-table/separator.rb:32:in `render'
     # ./lib/terminal-table/table.rb:171:in `block in render'
     # ./lib/terminal-table/table.rb:171:in `map'
     # ./lib/terminal-table/table.rb:171:in `render'
     # ./spec/table_spec.rb:126:in `block (2 levels) in <module:Terminal>'

Finished in 0.0141 seconds (files took 0.07159 seconds to load)
54 examples, 1 failure

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

Successfully merging this pull request may close these issues.

None yet

1 participant