I can’t seem to get a £ symbol to display correctly in a form select
element.
I have tried:
number_to_currency(u.price, :unit => “£”)
number_to_currency(u.price, :unit => “£”)
h ( number_to_currency(u.price, :unit => “£”) )
h ( number_to_currency(u.price, :unit => “£”) )
They all display a ? or “£”
Is there a way around this?
I just noticed I posted this in the wrong forum :-p
It should have been in the rails forum
Op vr 17 aug 10:10:04 2007 CEST schreef James Sturrock in
de nieuwsgroep ‘comp.lang.ruby’:
Is there a way around this?
Are u using a character set that contains the pound sign? (Like UTF-8)
James Sturrock wrote:
I can’t seem to get a £ symbol to display correctly in a form select
element.
I have tried:
number_to_currency(u.price, :unit => “£”)
number_to_currency(u.price, :unit => “£”)
h ( number_to_currency(u.price, :unit => “£”) )
h ( number_to_currency(u.price, :unit => “£”) )
They all display a ? or “£”
Is there a way around this?
Well, you should close it with a ;, “£”, not “£”.
Regards
Stefan
Stefan R. wrote:
Well, you should close it with a ;, “£”, not “£”.
Regards
Stefan
I have tried it with the ‘;’ and its still doesn’t work. Has anybody
else managed to display a £ sign in a form select?
Stefan R. wrote:
I don’t have any problem with neither £ nor with charset set to
utf-8 and a literal £ in utf-8.
Maybe you should take a look at what rails emits? (I don’t use rails, so
forgive my ignorance, but maybe rails escapes the £ to
&ound;?)
Regards
Stefan
Rails is outputting £
I don’t think this is a character set issue as I am displaying the £
sign elsewhere on the page (just as text not in a form element) and it
displays correctly.
James Sturrock wrote:
Stefan R. wrote:
Well, you should close it with a ;, “£”, not “£”.
Regards
Stefan
I have tried it with the ‘;’ and its still doesn’t work. Has anybody
else managed to display a £ sign in a form select?
I don’t have any problem with neither £ nor with charset set to
utf-8 and a literal £ in utf-8.
Maybe you should take a look at what rails emits? (I don’t use rails, so
forgive my ignorance, but maybe rails escapes the £ to
&ound;?)
Regards
Stefan
I have managed to fix this using the CGI::unescapeHTML() method 