Skip to content

Commit

Permalink
Bypass Encoding::CompatibilityError
Browse files Browse the repository at this point in the history
  • Loading branch information
RabidFire committed May 27, 2019
1 parent ea3ee5b commit c84b746
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/ruby-rtf/parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,11 @@ def handle_control(name, val, src, current_pos)
else
[val].pack('U*')
end
current_section[:text] << char
begin
current_section[:text] << char
rescue Encoding::CompatibilityError => e
nil
end
end

when *[:rquote, :lquote] then add_modifier_section({name => true}, "'")
Expand Down

0 comments on commit c84b746

Please sign in to comment.