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 %> <p> <b><%= column.human_name %>:</b> <%=h @product.send(column.name) %> </p> <% end %> but when i construct my own view, and use: <p><%= @product.price_prefix %><%= sprintf("%0.2f",@product.price) %></p> the Â£ displays as ablack diamond and white question mark. Whats that all about?
on 2007-03-01 15:59
on 2007-03-01 17:14
> > 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
on 2007-03-01 17:33
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.
on 2007-03-01 19:22
Try put an 'H' when you output ruby code, eg: <p> <%=h @product.price_prefix %> <%=h sprintf("%0.2f",@product.price)%> </p> <%=h CONTENT %> will escape things for you. Jorge On 3/1/07, Jon <email@example.com> wrote: > Posted via http://www.ruby-forum.com/. > > > > -- ------------------------------- Jorge Sousa
on 2007-03-01 21:33
Thanks Jorge, unfortunately it had no effect.