jon
March 1, 2007, 3:59pm
1
Hi, under webrick the character, £, displays fine. Under apache it has
some problems.
The £ displays fine on my administrator page, using the default
generated code:
<% for column in Product.content_columns %>
<%= column.human_name %>: <%=h @product.send(column.name) %>
<% end %>
but when i construct my own view, and use:
<%= @product.price_prefix %><%= sprintf("%0.2f",@product.price)
%>
the £ displays as ablack diamond and white question mark.
Whats that all about?
jon
March 1, 2007, 5:14pm
2
the £ displays as ablack diamond and white question mark.
Whats that all about?
The pound sign should be the character entity: £
Various page encodings will probably mess with it in different ways
otherwise.
Regards,
Andrew
jon
March 1, 2007, 5:33pm
3
Thanks andrew, unfortunatly this is user entered content, i feel its not
reasonable to ask them to enter £.
But i dont understand how it can be displayed correctly, and incorrectly
on the same site, rails is doing something different when it renders
these views.
jon
March 1, 2007, 9:33pm
4
Thanks Jorge, unfortunately it had no effect.
jon
March 1, 2007, 7:22pm
5
Try put an ‘H’ when you output ruby code, eg:
<%=h @product.price_prefix %>
<%=h sprintf("%0.2f",@product.price)%>
<%=h CONTENT %>
will escape things for you.
Jorge
On 3/1/07, Jon [email protected] wrote:
Posted via http://www.ruby-forum.com/ .
–
Jorge S.