https://www.redmine.org/https://www.redmine.org/favicon.ico?16793021292013-03-04T19:47:04ZRedmineRedmine - Defect #13354: PDF export: incompatible character encodings: UTF-8 and ASCII-8BIThttps://www.redmine.org/issues/13354?journal_id=463202013-03-04T19:47:04ZIvan Cenov
<ul></ul><p>This error occurs in current trunk, <a class="changeset" title="Merged r11530 from trunk to 2.3-stable (#13339) Vietnamese translation changed by Minh Thien Ngu..." href="https://www.redmine.org/projects/redmine/repository/svn/revisions/11535">r11535</a> too.</p> Redmine - Defect #13354: PDF export: incompatible character encodings: UTF-8 and ASCII-8BIThttps://www.redmine.org/issues/13354?journal_id=463212013-03-04T19:50:45ZIvan Cenov
<ul></ul><p>Category: PDF export</p> Redmine - Defect #13354: PDF export: incompatible character encodings: UTF-8 and ASCII-8BIThttps://www.redmine.org/issues/13354?journal_id=463222013-03-04T20:56:34ZIvan Cenov
<ul></ul><p>Something wrong with 'value' at <a class="source" href="https://www.redmine.org/projects/redmine/repository/svn/entry/trunk/app/helpers/issues_helper.rb#L336">source:/trunk/app/helpers/issues_helper.rb#L336</a><br /><pre>
l(:text_journal_changed, :label => label, :old => old_value, :new => value).html_safe
</pre>I can't tell much more...</p> Redmine - Defect #13354: PDF export: incompatible character encodings: UTF-8 and ASCII-8BIThttps://www.redmine.org/issues/13354?journal_id=463252013-03-04T22:15:30ZToshi MARUYAMA
<ul><li><strong>Category</strong> set to <i>PDF export</i></li></ul> Redmine - Defect #13354: PDF export: incompatible character encodings: UTF-8 and ASCII-8BIThttps://www.redmine.org/issues/13354?journal_id=463492013-03-06T11:06:48ZFilou Centrinov
<ul></ul><p>I can't reproduce your error. I used a cyrillic (russian) status. Are you using the export for a single issue or the issue overview export? Could you give a more exact process how I can reproduce this error for a new issue? May also with a screenshot.</p> Redmine - Defect #13354: PDF export: incompatible character encodings: UTF-8 and ASCII-8BIThttps://www.redmine.org/issues/13354?journal_id=463602013-03-06T17:45:33ZIvan Cenov
<ul><li><strong>File</strong> <a href="/attachments/9228">Capture.PNG</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/9228/Capture.PNG">Capture.PNG</a> added</li></ul><p>I tested with issue overview export. Now tested trunk without any plugins:</p>
<ol>
<li>Created a task with status <strong>Назначена</strong> (Cyrillic)</li>
<li>Test PDF export = successful</li>
<li>Changed status to <strong>In progress</strong> (latin)</li>
<li>Test PDF export = successful</li>
<li>Changed status to <strong>Приключена</strong> (Cyrillic)</li>
<li>Test PDF export = not successful</li>
</ol>
<p>Here is what I did step by step:<br /><img src="https://www.redmine.org/attachments/download/9229/Capture.PNG" alt="" /></p> Redmine - Defect #13354: PDF export: incompatible character encodings: UTF-8 and ASCII-8BIThttps://www.redmine.org/issues/13354?journal_id=463662013-03-06T20:23:56ZFilou Centrinov
<ul></ul><p>It is weird. At first I couldn't reproduce this error. Than I switch to bulgarian profil language and I got also the error. When I switch back to german profil language this error could be reproduced again although I couldn't reproduce this error first.</p> Redmine - Defect #13354: PDF export: incompatible character encodings: UTF-8 and ASCII-8BIThttps://www.redmine.org/issues/13354?journal_id=463692013-03-06T21:43:28ZIvan Cenov
<ul></ul><p>Is it possible something wrong in config/locales/bg.yml to activate this behavior. I am the translator of Redmine to Bulgarian language; looked at bg.yml but did not find anything suspicious in it...</p> Redmine - Defect #13354: PDF export: incompatible character encodings: UTF-8 and ASCII-8BIThttps://www.redmine.org/issues/13354?journal_id=463702013-03-06T21:50:01ZIvan Cenov
<ul><li><strong>File</strong> <a href="/attachments/9229">Capture.PNG</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/9229/Capture.PNG">Capture.PNG</a> added</li></ul><p>tested with Russian locale - the error still here:<br /><img src="https://www.redmine.org/attachments/download/9229/Capture.PNG" alt="" /></p> Redmine - Defect #13354: PDF export: incompatible character encodings: UTF-8 and ASCII-8BIThttps://www.redmine.org/issues/13354?journal_id=464022013-03-07T13:14:53ZFilou Centrinov
<ul></ul><p>I got thiserror everytime when I reset the status to a status with non-latain characters. With the initial status there is no problem to receive the pdf file. Also with a german status "Gelöst" it will fail to produce a pdf file. The pdf export succeeds when the last status had been in latain letters.</p> Redmine - Defect #13354: PDF export: incompatible character encodings: UTF-8 and ASCII-8BIThttps://www.redmine.org/issues/13354?journal_id=464602013-03-08T14:36:19ZJun NAITOH
<ul></ul><p>I reproduced your error.</p>
<ol>
<li>Set English locale.</li>
<li>load English default data.</li>
<li>Select "Administration" -> "Issue statuses" setting. And, "In Progress" was rewritten to "В работе" on Issue statuses setting.</li>
<li>create New Issue (Status : "New")</li>
<li>change status : from "New" to "В работе" </li>
<li>Select My account -> Language : change from English to Russian</li>
<li>Select Issue and export to PDF, but PDF export Error occured.</li>
</ol>
<a name="my-environment"></a>
<h3 >my environment<a href="#my-environment" class="wiki-anchor">¶</a></h3>
<ul>
<li>Redmine 2.2.2 and trunk</li>
<li>Ruby 1.9.3-p392</li>
<li>CentOS 6</li>
</ul>
<a name="ad-hoc-patch"></a>
<h3 >ad-hoc patch<a href="#ad-hoc-patch" class="wiki-anchor">¶</a></h3>
<pre>
--- app/helpers/issues_helper.rb (revision 11561)
+++ app/helpers/issues_helper.rb (working copy)
@@ -333,7 +333,7 @@
case detail.property
when 'attr', 'cf'
if detail.old_value.present?
- l(:text_journal_changed, :label => label, :old => old_value, :new => value).html_safe
+ l(:text_journal_changed, :label => label, :old => old_value, :new => value.force_encoding('UTF-8')).html_safe
elsif multiple
l(:text_journal_added, :label => label, :value => value).html_safe
else
</pre>
<p>I wrote ad-hoc patch.<br />However, I do not know for this problem to occur why, Sorry.</p> Redmine - Defect #13354: PDF export: incompatible character encodings: UTF-8 and ASCII-8BIThttps://www.redmine.org/issues/13354?journal_id=464652013-03-08T17:18:59ZFilou Centrinov
<ul></ul><p>With "Jun NAITOH"-Patch you get also an error, when your the initial status had a non-latain letter.</p>
<p>Improvment of quick & dirty patch:<br /><pre>
--- app/helpers/issues_helper.rb (revision 11561)
+++ app/helpers/issues_helper.rb (working copy)
@@ -333,7 +333,7 @@
case detail.property
when 'attr', 'cf'
if detail.old_value.present?
- l(:text_journal_changed, :label => label, :old => old_value, :new => value).html_safe
+ l(:text_journal_changed, :label => label, :old => old_value.force_encoding('UTF-8'), :new => value.force_encoding('UTF-8')).html_safe
elsif multiple
l(:text_journal_added, :label => label, :value => value).html_safe
else
</pre></p> Redmine - Defect #13354: PDF export: incompatible character encodings: UTF-8 and ASCII-8BIThttps://www.redmine.org/issues/13354?journal_id=464732013-03-09T07:11:50ZIvan Cenov
<ul></ul><p>Jun NAITOH and Filou Centrinov, I confirm your patch helped.</p>
<p>I think (by analogy with your patch) the whole part should be repaired:<br /><pre>
elsif detail.value.present?
case detail.property
when 'attr', 'cf'
if detail.old_value.present?
l(:text_journal_changed, :label => label, :old => old_value.force_encoding('UTF-8'), :new => value.force_encoding('UTF-8')).html_safe
elsif multiple
l(:text_journal_added, :label => label, :value => value).html_safe
else
l(:text_journal_set_to, :label => label, :value => value).html_safe
end
when 'attachment'
l(:text_journal_added, :label => label, :value => value).html_safe
end
else
l(:text_journal_deleted, :label => label, :old => old_value).html_safe
end
</pre>should be changed to<br /><pre>
elsif detail.value.present?
case detail.property
when 'attr', 'cf'
if detail.old_value.present?
l(:text_journal_changed, :label => label, :old => old_value.force_encoding('UTF-8'), :new => value.force_encoding('UTF-8')).html_safe
elsif multiple
l(:text_journal_added, :label => label, :value => value.force_encoding('UTF-8')).html_safe
else
l(:text_journal_set_to, :label => label, :value => value.force_encoding('UTF-8')).html_safe
end
when 'attachment'
l(:text_journal_added, :label => label, :value => value.force_encoding('UTF-8')).html_safe
end
else
l(:text_journal_deleted, :label => label, :old => old_value.force_encoding('UTF-8')).html_safe
end
</pre>But I think this is repair of the consequences and not of the root cause.</p> Redmine - Defect #13354: PDF export: incompatible character encodings: UTF-8 and ASCII-8BIThttps://www.redmine.org/issues/13354?journal_id=465482013-03-11T13:30:16ZAlbert Shakirov
<ul></ul><p>I also had this problem, and did the same thing <em>:old => old_value.force_encoding('UTF-8'), :new => value.force_encoding('UTF-8')</em><br />one week ago. But today I got a problem with this patch: when I tried to change the "% Done" field from 70% to 100% in the issue, I got another error 500:<br /><pre>
ActionView::Template::Error (undefined method `force_encoding' for 70:Fixnum):
1: <%= l(:text_issue_updated, :id => "##{@issue.id}", :author => @journal.user) %>
2:
3: <% details_to_strings(@journal.details, true).each do |string| -%>
4: <%= string %>
5: <% end -%>
6:
app/helpers/issues_helper.rb:335:in `show_detail'
app/helpers/issues_helper.rb:238:in `block in details_to_strings'
app/helpers/issues_helper.rb:223:in `details_to_strings'
app/views/mailer/issue_edit.text.erb:3:in `_app_views_mailer_issue_edit_text_erb__1046372188_95127910'
app/models/mailer.rb:417:in `block in mail'
app/models/mailer.rb:416:in `mail'
app/models/mailer.rb:76:in `issue_edit'
app/models/mailer.rb:427:in `initialize'
app/models/mailer.rb:440:in `method_missing'
app/models/journal_observer.rb:26:in `after_create'
app/models/journal.rb:52:in `save'
app/models/issue.rb:1362:in `create_journal'
app/models/issue.rb:965:in `block in save_issue_with_child_records'
app/models/issue.rb:952:in `save_issue_with_child_records'
app/controllers/issues_controller.rb:176:in `update
</pre></p>
<p>So I suggest slightly modificated solution:<br /><pre>
when 'attr', 'cf'
if detail.old_value.present?
m_old_value=old_value
m_old_value.force_encoding("UTF-8") if m_old_value.respond_to?(:force_encoding)
m_value=value
m_value.force_encoding("UTF-8") if m_value.respond_to?(:force_encoding)
l(:text_journal_changed, :label => label, :old => m_old_value, :new => m_value).html_safe
elsif multiple
</pre></p>
<p>I'm not good in programming, so please forgive my not-very-optimal variant.</p> Redmine - Defect #13354: PDF export: incompatible character encodings: UTF-8 and ASCII-8BIThttps://www.redmine.org/issues/13354?journal_id=466302013-03-13T13:11:22ZJun NAITOH
<ul><li><strong>File</strong> <a href="/attachments/9286">issues_helper.rb_r11621.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/9286/issues_helper.rb_r11621.patch">issues_helper.rb_r11621.patch</a> added</li></ul><p>I think that this problem was caused by find_name_by_reflection method.<br />On pdf export function, sometimes was returned ASCII-8BIT encoding by find_name_by_reflection method.</p>
<p>I rewrote patch.</p> Redmine - Defect #13354: PDF export: incompatible character encodings: UTF-8 and ASCII-8BIThttps://www.redmine.org/issues/13354?journal_id=467062013-03-16T06:45:40ZIvan Cenov
<ul></ul><p>Is it possible to include this patch in version 2.3.0 ?</p> Redmine - Defect #13354: PDF export: incompatible character encodings: UTF-8 and ASCII-8BIThttps://www.redmine.org/issues/13354?journal_id=467072013-03-16T06:55:58ZToshi MARUYAMA
<ul><li><strong>Target version</strong> set to <i>2.2.4</i></li></ul> Redmine - Defect #13354: PDF export: incompatible character encodings: UTF-8 and ASCII-8BIThttps://www.redmine.org/issues/13354?journal_id=467082013-03-16T09:54:53ZToshi MARUYAMA
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>Closed</i></li><li><strong>Resolution</strong> set to <i>Fixed</i></li></ul><p>Committed in trunk <a class="changeset" title="PDF: fix incompatible character encodings: UTF-8 and ASCII-8BIT (#13354) Contributed by Jun NAITOH." href="https://www.redmine.org/projects/redmine/repository/svn/revisions/11637">r11637</a>, 2.2-stable <a class="changeset" title="Merged r11637 from trunk to 2.2-stable (#13354) PDF: fix incompatible character encodings: UTF-8..." href="https://www.redmine.org/projects/redmine/repository/svn/revisions/11638">r11638</a> and 2.3-stable <a class="changeset" title="Merged r11637 from trunk to 2.3-stable (#13354) PDF: fix incompatible character encodings: UTF-8..." href="https://www.redmine.org/projects/redmine/repository/svn/revisions/11639">r11639</a>, thanks.</p> Redmine - Defect #13354: PDF export: incompatible character encodings: UTF-8 and ASCII-8BIThttps://www.redmine.org/issues/13354?journal_id=492402013-05-08T10:50:13ZAlexandr Sobolev
<ul></ul><p>Hello!<br />I'm configured notification via mail<br />My config file:<br /><pre>
production:
email_delivery:
delivery_method: :smtp
smtp_settings:
address: smtp.mail.ru
domain: mail.ru
port: 25
authentication: :login
user_name: 'test@mail.ru'
password: 'blabla'</pre></p>
<p>When i send test mail, get error:<br /><pre>
Encoding::CompatibilityError (incompatible character encodings: UTF-8 and ASCII-8BIT):
lib/redmine/i18n.rb:32:in `l'
app/controllers/admin_controller.rb:68:in `rescue in test_email'
app/controllers/admin_controller.rb:64:in `test_email'
</pre></p>
<pre>
Environment:
Redmine version 2.3.0.stable
Ruby version 1.9.3 (x86_64-linux)
Rails version 3.2.13
Environment production
Database adapter Mysql2
</pre>
<p>Help please!<br />Thanks!</p> Redmine - Defect #13354: PDF export: incompatible character encodings: UTF-8 and ASCII-8BIThttps://www.redmine.org/issues/13354?journal_id=492412013-05-08T10:56:36ZToshi MARUYAMA
<ul></ul><p>Alexandr Sobolev wrote:</p>
<blockquote>
<p>Help please!<br />Thanks!</p>
</blockquote>
<p>Do not post to unrelated issue. <br />See <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Defect: Issue Editing/Viewing - ASCII-8BIT/UTF-8 Problems (Closed)" href="https://www.redmine.org/issues/14009#note-10">#14009#note-10</a>.</p>