# Encoding problems, applying a patch, how to?

**URL:** <https://www.ruby-forum.com/t/encoding-problems-applying-a-patch-how-to/188071>\
**Category:** Rails\
**Created:** [May 5, 2010, 10:02am UTC](https://www.ruby-forum.com/t/encoding-problems-applying-a-patch-how-to/188071 "2010-05-05T10:02:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![samuel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/34f0e0/32.png) [@samuel](https://www.ruby-forum.com/u/samuel)\
**Post date:** [May 5, 2010, 10:02am UTC](https://www.ruby-forum.com/t/encoding-problems-applying-a-patch-how-to/188071/1 "2010-05-05T10:02:37Z")

</div>

So, i’m facing issues with encoding, since I need to write an  
application in portuguese-brazilian.

This is the error i’m getting: “incompatible character encodings:  
UTF-8 and ASCII-8BIT”

The curious thing is that i have a few other views with “special”  
characters, like Á or Ç, and all of them works. I have saved this view  
using the UTF-8 char encoding and also, as you can see, added the  
#enconding: UTF-8 comment in the top of the code. The yes\_or\_no method  
returns both words “Sim” or “Não”, but that actually works, since I  
added the enconding comment. I recently added the word “Descrição” to  
the view itself, and the word “Próximo” to the will\_paginate method at  
the bottom, and both fires the same error.

So, I found a patch over the internet wich is supposed to fix it, but  
i really don’t know how to apply it. So, first, where do I have to  
place the patch file, and then, what code should I use to run the  
patch?

here is the view code, in case anybody can help me in another way:

\<% # encoding: UTF-8

%\>

# Projects

\<%= link\_to "New Project", :action =\> "edit" %\>

\<% if flash[:notice] %\>

\<%= flash[:notice] %\>

\<% end %\> \<% @projects.each do |project| %\> \<% end %\>

| Name | Descrição | Ativo | Acoes |
| --- | --- | --- | --- |
| \<%= project.name %\> | \<%= project.description %\> | \<%= yes\_or\_no?(project.active?) %\> | \<%= link\_to 'Editar', { :action=\> :edit , :id =\> project.id } %\> | \<%= link\_to 'Apagar', { :action=\> :delete, :id =\> project.id}, :confirm =\> "Tem certeza?" %\> |

\<%= will\_paginate @projects, {:previous\_label =\> "", :next\_label =\> "Próximo" } %\>

please, any light?

---

<div class="post-metadata">

**Author:** ![samuel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/34f0e0/32.png) [@samuel](https://www.ruby-forum.com/u/samuel)\
**Post date:** [May 5, 2010, 11:48am UTC](https://www.ruby-forum.com/t/encoding-problems-applying-a-patch-how-to/188071/2 "2010-05-05T11:48:34Z")

</div>

Hello,  
I’m having the same exact problem - I’m developing an app in french.  
Let me know if you figure out how to apply the patch and I’ll do the  
same.

E

---

<div class="post-metadata">

**Author:** ![samuel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/34f0e0/32.png) [@samuel](https://www.ruby-forum.com/u/samuel)\
**Post date:** [May 5, 2010, 11:50am UTC](https://www.ruby-forum.com/t/encoding-problems-applying-a-patch-how-to/188071/3 "2010-05-05T11:50:19Z")

</div>

oh actually someone replied to my post:

[http://groups.google.com/group/rubyonrails-talk/browse\_thread/thread/e783f403919ec952/e8d18d777d44778b#e8d18d777d44778b](http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/e783f403919ec952/e8d18d777d44778b#e8d18d777d44778b)

I’ll try the suggestion out and hopefully have some luck.
