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 é <html> <head> <meta http-equiv="content-type" content="text/ html;charset=iso-8859-1" /> 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
On Tue, May 26, 2009 at 5:39 AM, tivrfoa <lescoutinhovr-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > 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 é > > <html> > <head> > <meta http-equiv="content-type" content="text/ > html;charset=iso-8859-1" /> > > 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! =DHave you tested with utf-8? That should have worked. Fidel.
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
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
I create almost only spanish applications, all with Ñ ñ, á é and so on, and use ONLY UTF-8. The meta directive <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> between the head tags does all the magic. Regards. Franco Catena. On May 26, 12:19 pm, tivrfoa <lescoutinh...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> 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
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? On May 26, 2:43 pm, Franco Catena <francocat...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I create almost only spanish applications, all with Ñ ñ, á é and so > on, and use ONLY UTF-8. > > The meta directive <meta http-equiv="Content-Type" content="text/html; > charset=utf-8" /> between the head tags does all the magic. > > Regards. > > Franco Catena. > > On May 26, 12:19 pm,tivrfoa<lescoutinh...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > 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
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 http://github.com/svenfuchs/rails-i18n/tree/master/rails/locale. Regards. Franco Catena. On May 26, 5:00 pm, tivrfoa <lescoutinh...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> 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? > > On May 26, 2:43 pm, Franco Catena <francocat...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > I create almost only spanish applications, all with Ñ ñ, á é and so > > on, and use ONLY UTF-8. > > > The meta directive <meta http-equiv="Content-Type" content="text/html; > > charset=utf-8" /> between the head tags does all the magic. > > > Regards. > > > Franco Catena. > > > On May 26, 12:19 pm,tivrfoa<lescoutinh...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > 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