Project

General

Profile

Actions

Defect #13354

closed

PDF export: incompatible character encodings: UTF-8 and ASCII-8BIT

Added by Ivan Cenov over 11 years ago. Updated over 11 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
PDF export
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

Description

When trying to export an issue to PDF an internal error happens:

Started GET "/issues/1932.pdf" for 192.168.60.101 at 2013-03-04 21:04:45 +0200
Processing by IssuesController#show as PDF
  Parameters: {"id"=>"1932"}
  Current user: jwalker (id=30)
Completed 500 Internal Server Error in 160ms

Encoding::CompatibilityError (incompatible character encodings: UTF-8 and ASCII-8BIT):
  lib/redmine/i18n.rb:30:in `l'
  app/helpers/issues_helper.rb:336:in `show_detail'
  app/helpers/issues_helper.rb:240:in `block in details_to_strings'
  app/helpers/issues_helper.rb:225:in `details_to_strings'
  lib/redmine/export/pdf.rb:687:in `block in issue_to_pdf'
  lib/redmine/export/pdf.rb:680:in `each'
  lib/redmine/export/pdf.rb:680:in `issue_to_pdf'
  app/controllers/issues_controller.rb:124:in `block (2 levels) in show'
  app/controllers/issues_controller.rb:116:in `show'

My system:
Redmine 2.2.3
Ruby 1.9.3
MySQL
Windows 7

gems

actionmailer (3.2.12, 3.2.11)
actionpack (3.2.12, 3.2.11)
activemodel (3.2.12, 3.2.11)
activerecord (3.2.12, 3.2.11)
activeresource (3.2.12, 3.2.11)
activesupport (3.2.12, 3.2.11)
arel (3.0.2)
bigdecimal (1.1.0)
builder (3.0.0)
bundler (1.2.1)
coderay (1.0.8)
daemons (1.1.9)
erubis (2.7.0)
eventmachine (1.0.0 x86-mingw32, 1.0.0.rc.4 x86-mingw32)
factory_girl (4.2.0, 4.1.0)
factory_girl_rails (4.2.1, 4.1.0)
hike (1.2.1)
i18n (0.6.1)
io-console (0.3)
journey (1.0.4)
jquery-rails (2.0.3)
json (1.7.7, 1.7.6)
mail (2.4.4)
metaclass (0.0.1)
mime-types (1.21, 1.19)
minitest (2.5.1)
mocha (0.12.3)
multi_json (1.6.0, 1.5.0)
mysql2 (0.3.11 x86-mingw32)
net-ldap (0.3.1)
pg (0.14.1 x86-mingw32)
polyglot (0.3.3)
rack (1.4.5, 1.4.4)
rack-cache (1.2)
rack-openid (1.3.1)
rack-ssl (1.3.3, 1.3.2)
rack-test (0.6.2)
rails (3.2.12, 3.2.11)
railties (3.2.12, 3.2.11)
rake (10.0.3)
rdoc (3.12.1, 3.12, 3.9.4)
rmagick (2.13.2, 2.13.1)
ruby-ole (1.2.11.6)
ruby-openid (2.1.8)
rubyzip (0.9.9)
shoulda (2.11.3)
simplecov (0.7.1)
simplecov-html (0.7.1)
simplecov-rcov (0.2.3)
spreadsheet (0.7.9, 0.7.6)
sprockets (2.2.2, 2.1.3)
sqlite3 (1.3.7 x86-mingw32)
thin (1.5.0)
thor (0.17.0, 0.16.0)
tilt (1.3.3)
treetop (1.4.12)
tzinfo (0.3.35)
yard (0.8.4.1, 0.8.3)

We use Redmine in Bulgarian language (cyrillic). Because of this, all issue statuses are stored in the database in Bulgarian language.

I did some research. This error does not occur always. I saw that it happens when:
- There is a status change.
and
- The new status is in Bulagrian language.
and
- this status change is reported as an issue note.

I did this test: translated several of the statuses in English and then:

1. Created an issue with status in Bulgarian (cyrillic) language.
2. The issue was expored succesfully.
3. Changed the status of the issue to any of the english-language statuses.
4. The issue was expored succesfully.
5. Changed the same status back to its initial status in Bulgarian (cyrillic) language.
6. The issue was not exported and above internal error occured.

So, I think that this specific error occurs when the new status of an issue is in cyrillic language.

I did SQL dump, and saw that all tables are utf-8 encoded, and cannot tell where this 'ASCII-8BIT' comes from.


Files

Capture.PNG (39.7 KB) Capture.PNG Ivan Cenov, 2013-03-06 18:44
Capture.PNG (32.6 KB) Capture.PNG Ivan Cenov, 2013-03-06 22:49
issues_helper.rb_r11621.patch (570 Bytes) issues_helper.rb_r11621.patch Jun NAITOH, 2013-03-13 13:50
Actions

Also available in: Atom PDF