# Special characters in db

**URL:** <https://www.ruby-forum.com/t/special-characters-in-db/96242>\
**Category:** Rails\
**Created:** [June 27, 2006, 4:55pm UTC](https://www.ruby-forum.com/t/special-characters-in-db/96242 "2006-06-27T16:55:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Johan\_Chaves\_Sabor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/4af34b/32.png) [@Johan\_Chaves\_Sabor](https://www.ruby-forum.com/u/Johan_Chaves_Sabor)\
**Post date:** [June 27, 2006, 4:55pm UTC](https://www.ruby-forum.com/t/special-characters-in-db/96242/1 "2006-06-27T16:55:01Z")

</div>

This is my first message in this list, so hi everybody!!! (by the way,  
sorry  
for my english)

I am developing a spanish applications, so some data has special  
characters  
(Ã¡, Ã©, Ã±, etc…) in database…

The problem is that those caracters display incorrectly in browser, how  
can  
I handle that situation with RoR???

Does it exist a “parser” that convert those characters in their  
respective  
html entities (á, é, ñ) to store it that way in  
database???

and if so, how can I tell to the helper methods (collection\_select, for  
example) to not escape those caracters (I tried to render data stored  
with  
html entities “collection\_select” scape the “&” character)

Regards!!!

---

<div class="post-metadata">

**Author:** ![Johan\_Chaves\_Sabor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/4af34b/32.png) [@Johan\_Chaves\_Sabor](https://www.ruby-forum.com/u/Johan_Chaves_Sabor)\
**Post date:** [June 27, 2006, 5:51pm UTC](https://www.ruby-forum.com/t/special-characters-in-db/96242/2 "2006-06-27T17:51:50Z")

</div>

Johan,  
Sorry for the 101 on language support but…

Create or save your content as UTF-8 encoded. Whichever option you  
choose, it is important to check that the character encoding of the page  
is properly declared in the tag of your HTML page. For example:

Also, remember that all HTML pages should declare their natural language  
for a variety of reasons. Some browsers can, and do, use this language  
information to determine the appropriate fonts. This is especially  
important for Asian pages. The content language can be declared in the

 tag like:

In this case the html tag is stating that the content is Spanish -  
Colombia.

Here is a list of language codes

> **[Using Language Identifiers (RFC 3066)](http://www.i18nguy.com/unicode/language-identifiers.html)**
>
> Draft document on using language tags

Ok, enough of the language 101 stuff.

You may be able to use; action\_mailer —\> vendor —\> tmail —\>  
quoting.rb as a template for a fix to the output/input. But, this is  
just a guess.

Scott.

Johan Chaves SaborÃ­o wrote:

> This is my first message in this list, so hi everybody!!! (by the way,  
> sorry  
> for my english)
> 
> I am developing a spanish applications, so some data has special  
> characters  
> (Ã¡, Ã©, Ã±, etc…) in database…
> 
> The problem is that those caracters display incorrectly in browser, how  
> can  
> I handle that situation with RoR???
> 
> Does it exist a “parser” that convert those characters in their  
> respective  
> html entities (á, é, ñ) to store it that way in  
> database???
> 
> and if so, how can I tell to the helper methods (collection\_select, for  
> example) to not escape those caracters (I tried to render data stored  
> with  
> html entities “collection\_select” scape the “&” character)
> 
> Regards!!!

---

<div class="post-metadata">

**Author:** ![Johan\_Chaves\_Sabor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/4af34b/32.png) [@Johan\_Chaves\_Sabor](https://www.ruby-forum.com/u/Johan_Chaves_Sabor)\
**Post date:** [June 2, 2007, 1:19am UTC](https://www.ruby-forum.com/t/special-characters-in-db/96242/3 "2007-06-02T01:19:22Z")

</div>

Sorry for the intrusion,  
but does exist a “parser” that convert those characters in their  
respective  
html entities (á, é, ñ) to store it that way in  
database???

Thanks
