TemplateError while rendering german special characters


I am using following versions of Ruby and Rails on arch linux

[[email protected]: kandibank ]$ ruby --version
ruby 1.9.1p429 (2010-07-02 revision 28523) [x86_64-linux]
[[email protected]: kandibank ]$ rails --version
Rails 2.3.8

I am using the sqllite database in development mode.

I can store a string having German special characters (umlauts) without
a problem i.e. Müller.

But when Rails try to render a page which extracts the same string from
the database it crashes with following error message. It is strange that
it renders the string “Löchen” properly which doesn’t come from

ActionView::TemplateError (incompatible character encodings: UTF-8 and
ASCII-8BIT) on line #28 of app/views/candidates/index.html.erb:

<%=h candidate.notes %>
26: <%= link_to ‘Ansehen’, candidate %>
27: <%= link_to ‘Editieren’, edit_candidate_path(candidate)
28: <%= link_to ‘Löchen’, candidate, :confirm => ‘Are you
sure?’, :method => :delete %>
30: <% end %>
app/views/candidates/index.html.erb:28:in `block in

app/views/candidates/index.html.erb:16:in each' app/views/candidates/index.html.erb:16 app/controllers/candidates_controller.rb:8:inindex’
internal:prelude:8:in synchronize' /usr/lib/ruby/1.9.1/webrick/httpserver.rb:111:inservice’
/usr/lib/ruby/1.9.1/webrick/httpserver.rb:70:in run' /usr/lib/ruby/1.9.1/webrick/server.rb:183:inblock in start_thread’

Rendered rescues/_trace (44.0ms)
Rendered rescues/_request_and_response (0.2ms)
Rendering rescues/layout (internal_server_error)

Any idea ?


This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs