# British Pound character in error messages

**URL:** <https://www.ruby-forum.com/t/british-pound-character-in-error-messages/55186>\
**Category:** Rails\
**Created:** [March 17, 2006, 6:59pm UTC](https://www.ruby-forum.com/t/british-pound-character-in-error-messages/55186 "2006-03-17T18:59:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![orotone](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/90db22/32.png) [@orotone](https://www.ruby-forum.com/u/orotone)\
**Post date:** [March 17, 2006, 6:59pm UTC](https://www.ruby-forum.com/t/british-pound-character-in-error-messages/55186/1 "2006-03-17T18:59:51Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![orotone](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/90db22/32.png) [@orotone](https://www.ruby-forum.com/u/orotone)\
**Post date:** [March 17, 2006, 7:09pm UTC](https://www.ruby-forum.com/t/british-pound-character-in-error-messages/55186/2 "2006-03-17T19:09:53Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![orotone](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/90db22/32.png) [@orotone](https://www.ruby-forum.com/u/orotone)\
**Post date:** [March 18, 2006, 6:14pm UTC](https://www.ruby-forum.com/t/british-pound-character-in-error-messages/55186/3 "2006-03-18T18:14:17Z")

</div>

“Timothy B.”  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote in message  
news:removed\_email\_address@domain.invalid…

> 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.
