diff options
author | Louise Crow <louise.crow@gmail.com> | 2015-02-13 13:47:04 +0000 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2015-02-13 13:47:04 +0000 |
commit | b0c0b6063c3b39e2da8e50fbaaf08f10adf45320 (patch) | |
tree | 29d91bccd57215d1e91ccbcffbeca89efd3a6a89 | |
parent | 890efdeae239d0c44def4b25c87441300fd1bbee (diff) | |
parent | 3d3f7b268c652a0e948c069b21a704091496506b (diff) |
Merge branch 'hotfix/0.20.0.11' into rails-3-develop
-rw-r--r-- | config/initializers/alaveteli.rb | 2 | ||||
-rw-r--r-- | lib/attachment_to_html/adapters/pdf.rb | 3 | ||||
-rw-r--r-- | spec/lib/attachment_to_html/adapters/pdf_spec.rb | 17 |
3 files changed, 17 insertions, 5 deletions
diff --git a/config/initializers/alaveteli.rb b/config/initializers/alaveteli.rb index 9493d4a1e..077db4757 100644 --- a/config/initializers/alaveteli.rb +++ b/config/initializers/alaveteli.rb @@ -10,7 +10,7 @@ load "debug_helpers.rb" load "util.rb" # Application version -ALAVETELI_VERSION = '0.20.0.10' +ALAVETELI_VERSION = '0.20.0.11' # Add new inflection rules using the following format # (all these examples are active by default): diff --git a/lib/attachment_to_html/adapters/pdf.rb b/lib/attachment_to_html/adapters/pdf.rb index b91958c52..3183d1fd0 100644 --- a/lib/attachment_to_html/adapters/pdf.rb +++ b/lib/attachment_to_html/adapters/pdf.rb @@ -73,11 +73,10 @@ module AttachmentToHTML html = AlaveteliExternalCommand.run("pdftohtml", "-nodrm", "-zoom", "1.0", "-stdout", "-enc", "UTF-8", - "-noframes", tempfile.path, :timeout => 30 + "-noframes", tempfile.path, :timeout => 30, :binary_output => false ) cleanup_tempfile(tempfile) - html end end diff --git a/spec/lib/attachment_to_html/adapters/pdf_spec.rb b/spec/lib/attachment_to_html/adapters/pdf_spec.rb index da79b2de0..f1ae4695c 100644 --- a/spec/lib/attachment_to_html/adapters/pdf_spec.rb +++ b/spec/lib/attachment_to_html/adapters/pdf_spec.rb @@ -15,7 +15,7 @@ describe AttachmentToHTML::Adapters::PDF do adapter = AttachmentToHTML::Adapters::PDF.new(attachment, :tmpdir => '/tmp') adapter.tmpdir.should == '/tmp' end - + end describe :title do @@ -23,7 +23,14 @@ describe AttachmentToHTML::Adapters::PDF do it 'uses the attachment filename for the title' do adapter.title.should == attachment.display_filename end - + + it 'returns the title encoded as UTF-8' do + if RUBY_VERSION.to_f >= 1.9 + adapter.title.encoding.should == Encoding.find('UTF-8') + end + end + + end describe :body do @@ -38,6 +45,12 @@ describe AttachmentToHTML::Adapters::PDF do adapter.body end + it 'returns the body encoded as UTF-8' do + if RUBY_VERSION.to_f >= 1.9 + adapter.body.encoding.should == Encoding.find('UTF-8') + end + end + end |