sandal/prawn — Issue #313: invalid multibyte character: /­?/
Author: vfrride
Created: 2011-12-30 20:29:36+00:00
State: open

Using JRuby 1.6.5 through Jetty. This does not happen when running through WEBrick.

When trying to process an object field defined as a string in a mysql database I get the attached stack trace.

"M12345".encoding returns 'utf-8'

I checked the encoding on the normalized soft hyphen, "\xAD", returned by the method of the same name and it comes back as ASCII-8BIT on both Jetty and WEBrick.

pdf.table [[@invoice.number]] # where number is a string... gives

org/jruby/RubyString.java:2914:in `gsub'
org/jruby/RubyString.java:2882:in `gsub'
//...//bundler/gems/prawn-b31489409765/lib/prawn/text/formatted/fragment.rb:225:in `process_soft_hyphens'
//...//bundler/gems/prawn-b31489409765/lib/prawn/text/formatted/fragment.rb:34:in `text'
//...//bundler/gems/prawn-b31489409765/lib/prawn/core/text/formatted/arranger.rb:275:in `set_fragment_measurements'
//...//bundler/gems/prawn-b31489409765/lib/prawn/core/text/formatted/arranger.rb:239:in `apply_font_size'
//...//bundler/gems/prawn-b31489409765/lib/prawn/core/text/formatted/arranger.rb:164:in `apply_font_settings'
//...//bundler/gems/prawn-b31489409765/lib/prawn/core/text.rb:212:in `character_spacing'
//...//bundler/gems/prawn-b31489409765/lib/prawn/core/text/formatted/arranger.rb:157:in `apply_font_settings'
//...//bundler/gems/prawn-b31489409765/lib/prawn/core/text/formatted/arranger.rb:274:in `set_fragment_measurements'
//...//bundler/gems/prawn-b31489409765/lib/prawn/core/text/formatted/arranger.rb:76:in `finalize_line'
org/jruby/RubyArray.java:1612:in `each'
//...//bundler/gems/prawn-b31489409765/lib/prawn/core/text/formatted/arranger.rb:68:in `finalize_line'
//...//bundler/gems/prawn-b31489409765/lib/prawn/core/text/formatted/line_wrap.rb:49:in `wrap_line'
//...//bundler/gems/prawn-b31489409765/lib/prawn/core/text/formatted/wrap.rb:45:in `wrap'
//...//bundler/gems/prawn-b31489409765/lib/prawn/text/formatted/box.rb:263:in `render'
//...//bundler/gems/prawn-b31489409765/lib/prawn/font.rb:96:in `font_size'
//...//bundler/gems/prawn-b31489409765/lib/prawn/text/formatted/box.rb:256:in `render'
//...//bundler/gems/prawn-b31489409765/lib/prawn/core/text.rb:194:in `text_rendering_mode'
//...//bundler/gems/prawn-b31489409765/lib/prawn/text/formatted/box.rb:247:in `render'
//...//bundler/gems/prawn-b31489409765/lib/prawn/core/text.rb:212:in `character_spacing'
//...//bundler/gems/prawn-b31489409765/lib/prawn/text/formatted/box.rb:246:in `render'
//...//bundler/gems/prawn-b31489409765/lib/prawn/font.rb:116:in `save_font'
//...//bundler/gems/prawn-b31489409765/lib/prawn/text/formatted/box.rb:245:in `render'
//...//bundler/gems/prawn-b31489409765/lib/prawn/text/box.rb:134:in `render'
//...//bundler/gems/prawn-b31489409765/lib/prawn/table/cell/text.rb:59:in `natural_content_height'
//...//bundler/gems/prawn-b31489409765/lib/prawn/table/cell/text.rb:95:in `with_font'
//...//bundler/gems/prawn-b31489409765/lib/prawn/font.rb:116:in `save_font'
//...//bundler/gems/prawn-b31489409765/lib/prawn/table/cell/text.rb:89:in `with_font'
//...//bundler/gems/prawn-b31489409765/lib/prawn/table/cell/text.rb:57:in `natural_content_height'
//...//bundler/gems/prawn-b31489409765/lib/prawn/table/cell.rb:325:in `content_height'
//...//bundler/gems/prawn-b31489409765/lib/prawn/table/cell.rb:298:in `height_ignoring_span'
//...//bundler/gems/prawn-b31489409765/lib/prawn/table/cell.rb:306:in `height'
//...//bundler/gems/prawn-b31489409765/lib/prawn/table.rb:381:in `row_heights'
org/jruby/RubyArray.java:1612:in `each'
//...//bundler/gems/prawn-b31489409765/lib/prawn/table.rb:377:in `row_heights'
//...//bundler/gems/prawn-b31489409765/lib/prawn/table.rb:529:in `set_row_heights'
//...//bundler/gems/prawn-b31489409765/lib/prawn/table.rb:138:in `initialize'
//...//bundler/gems/prawn-b31489409765/lib/prawn/table.rb:27:in `table'
app/views/outgoing_invoices/show.pdf.prawn:10:in `_app_views_outgoing_invoices_show_pdf_prawn___1399492332_32302'
org/jruby/RubyBasicObject.java:1700:in `__send__'
org/jruby/RubyKernel.java:2122:in `send'