Forum: Ruby on Rails British Pound character in error messages

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Ddd11872984864786c14992b99ab4d2d?d=identicon&s=25 Alan Bullock (Guest)
on 2006-03-17 18:59
(Received via mailing list)
some of my validation error messages contain a pound sign (the British
currency, not #)
however, this get's shown as a question mark in the view. i can get
round it
by using the html reference (£) instead of the literal character,
but
it seems a little counter-intuitive to handle this in the model... isn't
it
view related?

any suggestions? I'm developing on webrick
24d3102d656a4654db23d28382a2d6f0?d=identicon&s=25 Timothy Bennett (Guest)
on 2006-03-17 19:09
(Received via mailing list)
You should set the character encoding in the page and response
headers to, er, some charset that contains the pound sign (I always
set them to utf8, which simplifies matters), so that the browser is
sure to use the correct charset when decoding the page.  Note that
your source files that contain non-ASCII characters need to be saved
using the same charset.

Tim
Ddd11872984864786c14992b99ab4d2d?d=identicon&s=25 Alan Bullock (Guest)
on 2006-03-18 18:14
(Received via mailing list)
"Timothy Bennett"
<timothy.s.bennett@gmail.com> wrote in message
news:706A49DB-D915-4A92-B69A-D417EB988A0E@gmail.com...
> You should set the character encoding in the page and response  headers
> to, er, some charset that contains the pound sign

@response.headers['Content-Type'] = 'text/html; charset=iso-8859-1'

that did the trick. thank you.
This topic is locked and can not be replied to.