ChiliProject is not maintained anymore. Please be advised that there will be no more updates.

We do not recommend that you setup new ChiliProject instances and we urge all existing users to migrate their data to a maintained system, e.g. Redmine. We will provide a migration script later. In the meantime, you can use the instructions by Christian Daehn.

unable to create a non ASCII subject issue on Ruby 1.9 (Bug #676)


Added by Toshi MARUYAMA at 2011-10-30 05:26 am. Updated at 2011-12-18 05:37 pm.


Status:Closed Start date:2011-10-30
Priority:Normal Due date:
Assignee:- % Done:

0%

Category:-
Target version:-
Remote issue URL: Affected version:master

Description

On 667c4d157fd1004afe730a5a98a24dbecb97bc72

[2011-10-30 14:21:03] ERROR Encoding::UndefinedConversionError: "\xE6" from ASCII-8BIT to UTF-8
    /home/xxxxx/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-2.3.14/lib/active_support/buffered_logger.rb:101:in `write'
    /home/xxxxx/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-2.3.14/lib/active_support/buffered_logger.rb:101:in `block in flush'
    <internal:prelude>:10:in `synchronize'
    /home/xxxxx/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-2.3.14/lib/active_support/buffered_logger.rb:98:in `flush'
    /home/xxxxx/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-2.3.14/lib/action_controller/dispatcher.rb:125:in `flush_logger'
    /home/xxxxx/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-2.3.14/lib/active_support/callbacks.rb:178:in `evaluate_method'
    /home/xxxxx/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-2.3.14/lib/active_support/callbacks.rb:166:in `call'
    /home/xxxxx/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-2.3.14/lib/active_support/callbacks.rb:90:in `block in run'
    /home/xxxxx/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-2.3.14/lib/active_support/callbacks.rb:90:in `reverse_each'
    /home/xxxxx/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-2.3.14/lib/active_support/callbacks.rb:90:in `run'
    /home/xxxxx/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-2.3.14/lib/active_support/callbacks.rb:276:in `run_callbacks'
    /home/xxxxx/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-2.3.14/lib/action_controller/dispatcher.rb:95:in `ensure in dispatch'
    /home/xxxxx/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-2.3.14/lib/action_controller/dispatcher.rb:95:in `dispatch'
    /home/xxxxx/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-2.3.14/lib/action_controller/dispatcher.rb:121:in `_call'
    /home/xxxxx/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-2.3.14/lib/action_controller/dispatcher.rb:130:in `block in build_middleware_stack'
    /home/xxxxx/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-2.3.14/lib/active_record/query_cache.rb:29:in `call'
    /home/xxxxx/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-2.3.14/lib/active_record/query_cache.rb:29:in `block in call'
    /home/xxxxx/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-2.3.14/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
    /home/xxxxx/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-2.3.14/lib/active_record/query_cache.rb:9:in `cache'
    /home/xxxxx/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-2.3.14/lib/active_record/query_cache.rb:28:in `call'
    /home/xxxxx/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-2.3.14/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
    /home/xxxxx/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-2.3.14/lib/action_controller/string_coercion.rb:25:in `call'
    /home/xxxxx/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.1.2/lib/rack/head.rb:9:in `call'
    /home/xxxxx/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.1.2/lib/rack/methodoverride.rb:24:in `call'
    /home/xxxxx/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-2.3.14/lib/action_controller/params_parser.rb:15:in `call'
    /home/xxxxx/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-2.3.14/lib/action_controller/session/cookie_store.rb:99:in `call'
    /home/xxxxx/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-2.3.14/lib/action_controller/failsafe.rb:26:in `call'
    /home/xxxxx/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.1.2/lib/rack/lock.rb:11:in `block in call'
    <internal:prelude>:10:in `synchronize'
    /home/xxxxx/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.1.2/lib/rack/lock.rb:11:in `call'
    /home/xxxxx/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-2.3.14/lib/action_controller/dispatcher.rb:106:in `call'
    /home/xxxxx/.rvm/gems/ruby-1.9.2-p290/gems/rails-2.3.14/lib/rails/rack/static.rb:31:in `call'
    /home/xxxxx/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.1.2/lib/rack/urlmap.rb:47:in `block in call'
    /home/xxxxx/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.1.2/lib/rack/urlmap.rb:41:in `each'
    /home/xxxxx/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.1.2/lib/rack/urlmap.rb:41:in `call'
    /home/xxxxx/.rvm/gems/ruby-1.9.2-p290/gems/rails-2.3.14/lib/rails/rack/log_tailer.rb:17:in `call'
    /home/xxxxx/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.1.2/lib/rack/content_length.rb:13:in `call'
    /home/xxxxx/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.1.2/lib/rack/handler/webrick.rb:48:in `service'
    /home/xxxxx/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service'
    /home/xxxxx/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run'
    /home/xxxxx/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'

non-ascii-subject.png (12.1 kB) Toshi MARUYAMA, 2011-10-30 05:26 am


Associated revisions

Revision 0d9e4196
Added by Jean-Philippe Lang at 2008-03-31 10:51 pm

Add overflow:auto to the content div (closes #676, #748, #961).

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1314 e93f8b46-1217-0410-a6f0-8f06a7374b81

Revision 21a45b4e
Added by Holger Just at 2011-10-30 11:25 am

[#676] Enforce UTF-8 encodings on the params hash

Contributed by Toshi MARUYAMA

History

Updated by Holger Just at 2011-10-30 08:20 am

I couldn't reproduce it with SQLite3 on Ruby 1.9.2-p290.

However, it seems that the mysql adapter doesn't play nice with set encodings. This is something if read numerous time on the internets. And it's probably why our tests break with this adapter only. See http://ci.chiliproject.org/job/chiliproject_master/DATABASE=mysql,RUBY=ruby-1.9.2-p290/114/

Could you please confirm that it works with mysql2 instead of mysql (if you are using that)? If not, please tell us your database adapter.

  • Status changed from Open to Needs more information

Updated by Toshi MARUYAMA at 2011-10-30 09:35 am

I use SQLite3.

  • Status changed from Needs more information to Open

Updated by Toshi MARUYAMA at 2011-10-30 09:45 am

$ locale
LANG=ja_JP.UTF-8
LC_CTYPE="en_US.UTF-8" 
LC_NUMERIC="en_US.UTF-8" 
LC_TIME="en_US.UTF-8" 
LC_COLLATE="en_US.UTF-8" 
LC_MONETARY="en_US.UTF-8" 
LC_MESSAGES="en_US.UTF-8" 
LC_PAPER="en_US.UTF-8" 
LC_NAME="en_US.UTF-8" 
LC_ADDRESS="en_US.UTF-8" 
LC_TELEPHONE="en_US.UTF-8" 
LC_MEASUREMENT="en_US.UTF-8" 
LC_IDENTIFICATION="en_US.UTF-8" 
LC_ALL=en_US.UTF-8

$ irb
irb(main):001:0> puts "\xe6\x97\xa5\xe6\x9c\xac\xe8\xaa\x9e" 
日本語
=> nil

Updated by Holger Just at 2011-10-30 10:28 am

Okay, I could reproduce the error it with your exact string but only when in development mode, when in production, it works. My previous tests included another string which also contained Japanese characters)

That said, I tried it with your patch from Redmine #4050-13 (committed in commit:c5da0b4) and it now works for me even in development mode. I'm still not overly happy with the state of things but I guess it doesn't get much better with Rails 2.3...

@Toshi: Please confirm that that patch works for you.

  • Status changed from Open to Needs more information

Updated by Felix Schäfer at 2011-10-30 10:38 am

Just give me a sec, I have some more test results, but someone updating the issue before I could send them ate my homework :-O

Updated by Holger Just at 2011-10-30 10:41 am

Testing is an actual issue, as I have not been able to design a test for that. Either it always works, or it fails in some other remote place...

Encoding sucks.... :)

Updated by Felix Schäfer at 2011-10-30 10:44 am

Environment as follows:

  • Gems
    • pg (0.9.0)
    • sqlite3 (1.3.4)
  • ruby
    • 1.9.2p290
  • DBs
    • postgres (PostgreSQL) 9.0.4
    • sqlite3 3.7.7.1
  • ChiliProject

On postgres, no problems either in production nor in development mode.

On sqlite, webrick shits its pants in development, so I can't say anything about that. In production, I get an error when inputting 日本語 as the issue title, though the error I get is:

Encoding::CompatibilityError (incompatible character encodings: UTF-8 and ASCII-8BIT):
  app/models/mailer.rb:47:in `issue_add'
  app/models/issue_observer.rb:20:in `after_create'
  /Users/felix/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/observer.rb:186:in `block in notify_observers'
  /Users/felix/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/observer.rb:185:in `each'
  /Users/felix/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/observer.rb:185:in `notify_observers'
  app/controllers/issues_controller.rb:122:in `create'
  <internal:prelude>:10:in `synchronize'
  /Users/felix/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service'
  /Users/felix/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run'
  /Users/felix/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'

I then tried the same deselecting the "send an email" checkbox, and everything went fine.

I'm not sure if the problem really is with sqlite, rails, the mailer or whatever, but the problem seems to be related to sending mails…

Updated by Felix Schäfer at 2011-11-13 08:43 pm

Felix Schäfer wrote:

In production, I get an error when inputting 日本語 as the issue title, though the error I get is:

[...]

I then tried the same deselecting the "send an email" checkbox, and everything went fine.

Can't reproduce this on current master anymore…

Updated by Holger Just at 2011-12-18 05:37 pm

This issue can't be reproduced anymore. If there are still issues with ruby 1.9 compatibility, please create a new issue.

  • Status changed from Needs more information to Closed

Also available in: Atom PDF