# TemplateError while rendering german special characters

**URL:** <https://www.ruby-forum.com/t/templateerror-while-rendering-german-special-characters/192044>\
**Category:** Rails\
**Created:** [July 22, 2010, 10:07pm UTC](https://www.ruby-forum.com/t/templateerror-while-rendering-german-special-characters/192044 "2010-07-22T22:07:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rangalo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/258eb7/32.png) [@rangalo](https://www.ruby-forum.com/u/rangalo)\
**Post date:** [July 22, 2010, 10:07pm UTC](https://www.ruby-forum.com/t/templateerror-while-rendering-german-special-characters/192044/1 "2010-07-22T22:07:28Z")

</div>

Hi

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

[hardik@sunshine: kandibank]$ ruby --version  
ruby 1.9.1p429 (2010-07-02 revision 28523) [x86\_64-linux]  
[hardik@sunshine: 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  
database.

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

\<%=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 %\>  
29:   
30: \<% end %\>  
31: 

```
app/views/candidates/index.html.erb:28:in `block in

```

\_run\_erb\_app47views47candidates47index46html46erb’  
app/views/candidates/index.html.erb:16:in `each' app/views/candidates/index.html.erb:16 app/controllers/candidates_controller.rb:8:in`index’  
internal:prelude:8:in `synchronize' /usr/lib/ruby/1.9.1/webrick/httpserver.rb:111:in`service’  
/usr/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run' /usr/lib/ruby/1.9.1/webrick/server.rb:183:in`block in start\_thread’

Rendered rescues/\_trace (44.0ms)  
Rendered rescues/\_request\_and\_response (0.2ms)  
Rendering rescues/layout (internal\_server\_error)

Any idea ?

regards,  
Hardik
