Skip to content

Instantly share code, notes, and snippets.

@bb
Created April 19, 2011 23:54
Show Gist options
  • Save bb/930013 to your computer and use it in GitHub Desktop.
Save bb/930013 to your computer and use it in GitHub Desktop.
# In a fresh Rails 3 project, running ruby-1.9.2-p180,
# the mail_to helper doesn't work with umlauts and encode-argument.
➜ ruby-192-rails-3-enc-test ○ rails c
Loading development environment (Rails 3.0.7)
ruby-1.9.2-p180 :001 > helper.mail_to "ä", "ä", :encode => :hex
Encoding::CompatibilityError: incompatible character encodings: ASCII-8BIT and UTF-8
from /Users/bb/.rvm/gems/ruby-1.9.2-p180/gems/actionpack-3.0.7/lib/action_view/helpers/tag_helper.rb:114:in `content_tag_string'
from /Users/bb/.rvm/gems/ruby-1.9.2-p180/gems/actionpack-3.0.7/lib/action_view/helpers/tag_helper.rb:79:in `content_tag'
from /Users/bb/.rvm/gems/ruby-1.9.2-p180/gems/actionpack-3.0.7/lib/action_view/helpers/url_helper.rb:512:in `mail_to'
from (irb):1
from /Users/bb/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.7/lib/rails/commands/console.rb:44:in `start'
from /Users/bb/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.7/lib/rails/commands/console.rb:8:in `start'
from /Users/bb/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.7/lib/rails/commands.rb:23:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
ruby-1.9.2-p180 :002 >
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment