# Iso-8859-1 no effect in browser

**URL:** <https://www.ruby-forum.com/t/iso-8859-1-no-effect-in-browser/168798>\
**Category:** Rails\
**Created:** [May 26, 2009, 6:40am UTC](https://www.ruby-forum.com/t/iso-8859-1-no-effect-in-browser/168798 "2009-05-26T06:40:24Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![tivrfoa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/c4cdca/32.png) [@tivrfoa](https://www.ruby-forum.com/u/tivrfoa)\
**Post date:** [May 26, 2009, 6:40am UTC](https://www.ruby-forum.com/t/iso-8859-1-no-effect-in-browser/168798/1 "2009-05-26T06:40:24Z")

</div>

hi folks!

I want to use characters with accent, like: é, ç, ã, ô. Then I changed  
from UTF-8 to iso-8859-1, so I can use é direct, instead of é

The strange is that when I go in View -\> Codification, it is marked  
Unicode (UTF-8). ☹  
But this is not the worst. The browser doesn’t change from special  
chars to its meaning.

validates\_format\_of :email,  
:with =\>  
%r{[\_a-z0-9-][\_a-z0-9-]_@[\_a-z0-9-][\_a-z0-9-]_.[\_a-z0-9-]  
[\_a-z0-9-]\*}i,  
:message =\> ‘está incorreto’

It display Email está incorreto.  
I want Email está incorreto.

Help meee! =D

---

<div class="post-metadata">

**Author:** ![tivrfoa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/c4cdca/32.png) [@tivrfoa](https://www.ruby-forum.com/u/tivrfoa)\
**Post date:** [May 26, 2009, 8:02am UTC](https://www.ruby-forum.com/t/iso-8859-1-no-effect-in-browser/168798/2 "2009-05-26T08:02:52Z")

</div>

On Tue, May 26, 2009 at 5:39 AM, tivrfoa [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> It display Email está incorreto.  
> I want Email está incorreto.
> 
> Help meee! =D

Have you tested with utf-8? That should have worked.

Fidel.

---

<div class="post-metadata">

**Author:** ![tivrfoa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/c4cdca/32.png) [@tivrfoa](https://www.ruby-forum.com/u/tivrfoa)\
**Post date:** [May 26, 2009, 3:26pm UTC](https://www.ruby-forum.com/t/iso-8859-1-no-effect-in-browser/168798/3 "2009-05-26T15:26:14Z")

</div>

tivrfoa wrote:

> I want to use characters with accent, like: é, ç, ã, ô. Then I changed  
> from UTF-8 to iso-8859-1, so I can use é direct, instead of é

That’s not what the charset= is for. You should use the correct entities  
if at  
all possible, and neither your editor…

> The strange is that when I go in View → Codification, it is marked  
> Unicode (UTF-8). ☹

…nor Ruby…

> validates\_format\_of :email,  
> :with =\> %r{[\_a-z0-9-][\_a-z0-9-]_@[\_a-z0-9-][\_a-z0-9-]_.[\_a-z0-9-]  
> [\_a-z0-9-]\*}i,  
> :message =\> ‘está incorreto’

…are bothering to read that directive. They are still defaulting to  
utf-8,  
which is good enough for 99.999% of all programming.

Further, both utf-8 and iso-8859-1 share many of the same Latin-1 code  
points,  
including é. Utf-8 merely gives the additional abilities to build the é out  
of  
an e and a modifying accent character, and the ability to read and write  
every  
other glyph in the world.

You would only use iso-8859-1 if you had a database with known  
iso-8859-1  
strings, AND if you did not want to simply Iconv them to UTF-8 before  
pushing  
them into your HTML.

–  
Phlip  
[http://twitter.com/Pen\_Bird](http://twitter.com/Pen_Bird)

---

<div class="post-metadata">

**Author:** ![tivrfoa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/c4cdca/32.png) [@tivrfoa](https://www.ruby-forum.com/u/tivrfoa)\
**Post date:** [May 26, 2009, 5:20pm UTC](https://www.ruby-forum.com/t/iso-8859-1-no-effect-in-browser/168798/4 "2009-05-26T17:20:18Z")

</div>

tks! it didn’t work in utf-8. if I use está (without the special  
character), it display an interrogation symbol (?)

Could someone try to use this =\> :message =\> ‘está incorreto’  
in some validation to see if it works?

How can I display “está”?

tks

---

<div class="post-metadata">

**Author:** ![tivrfoa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/c4cdca/32.png) [@tivrfoa](https://www.ruby-forum.com/u/tivrfoa)\
**Post date:** [May 26, 2009, 7:44pm UTC](https://www.ruby-forum.com/t/iso-8859-1-no-effect-in-browser/168798/5 "2009-05-26T19:44:40Z")

</div>

I create almost only spanish applications, all with Ã‘ Ã±, Ã¡ Ã© and so  
on, and use ONLY UTF-8.

The meta directive between the head tags does all the magic.

Regards.

Franco C…

---

<div class="post-metadata">

**Author:** ![tivrfoa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/c4cdca/32.png) [@tivrfoa](https://www.ruby-forum.com/u/tivrfoa)\
**Post date:** [May 26, 2009, 10:00pm UTC](https://www.ruby-forum.com/t/iso-8859-1-no-effect-in-browser/168798/6 "2009-05-26T22:00:55Z")

</div>

thansk Franco.

it works on the view, but not work in the model (at least here)  
did you try to add a message in some model with accent?

---

<div class="post-metadata">

**Author:** ![tivrfoa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/c4cdca/32.png) [@tivrfoa](https://www.ruby-forum.com/u/tivrfoa)\
**Post date:** [May 27, 2009, 12:30am UTC](https://www.ruby-forum.com/t/iso-8859-1-no-effect-in-browser/168798/7 "2009-05-27T00:30:26Z")

</div>

Yes, i use it a lot, but in this form:

record.errors.add attr, :invalid # or any other

And then in the config/locales/es.yml

es:  
activerecord:  
errors:  
messages:  
invalid: “no es válido”

```
  # Custom for one model
  models:
    somemoder:
      attributes:
        someattribute:
          invalid: "es inválido"

```

I never use it in the direct form, always with the I18n package. If  
you want a complete example see  
[rails-i18n/rails/locale at master · svenfuchs/rails-i18n · GitHub](http://github.com/svenfuchs/rails-i18n/tree/master/rails/locale).

Regards.

Franco C…

---

<div class="post-metadata">

**Author:** ![tivrfoa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/c4cdca/32.png) [@tivrfoa](https://www.ruby-forum.com/u/tivrfoa)\
**Post date:** [May 28, 2009, 5:10pm UTC](https://www.ruby-forum.com/t/iso-8859-1-no-effect-in-browser/168798/8 "2009-05-28T17:10:24Z")

</div>

thanks folks.

I solved the problem using a different text editor. Now I’m using RoRED. It’s an amazing editor, but  
only available for Windows.  
The problem was the encode of the files.
