Forum: Ruby on Rails How to display ë, ä, á, ... in view

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.
91308e9bc88cb069fd1bcf88e910d042?d=identicon&s=25 Nick Snels (nicksnels)
on 2005-12-10 21:44
Hi,

I'm trying to at a select box to my page like so:

<%= select('company', 'country', [['België', 'BE'],
                                  ['Nederland', 'NL']]) %>

But the ë in België is displayed as ? in Firefox and as || in IE5.

I have already placed some html code at the top of the page:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitiona...
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title><%= @title %></title>
  <meta http-equiv="content-type" content="text/html; charset=utf-8">

But that doesn't solve the problem. Anybody managed to solve it? All
help is welcome. Thanks.

Kind regards,

Nick
3a83969376c805ef5b6042191fdb0ff3?d=identicon&s=25 Andreas S. (andreas)
on 2005-12-10 22:27
nicksnels wrote:
> Hi,
>
> I'm trying to at a select box to my page like so:
>
> <%= select('company', 'country', [['België', 'BE'],
>                                   ['Nederland', 'NL']]) %>
>
> But the ë in België is displayed as ? in Firefox and as || in IE5.

Make sure your editor saves the file in UTF-8 charset.
91308e9bc88cb069fd1bcf88e910d042?d=identicon&s=25 Nick Snels (nicksnels)
on 2005-12-10 22:40
Hi Andreas,

changed editor settings to UTF-8 and it worked magically! Thanks!!

Nick

andreas wrote:
> nicksnels wrote:
>> Hi,
>>
>> I'm trying to at a select box to my page like so:
>>
>> <%= select('company', 'country', [['België', 'BE'],
>>                                   ['Nederland', 'NL']]) %>
>>
>> But the ë in België is displayed as ? in Firefox and as || in IE5.
>
> Make sure your editor saves the file in UTF-8 charset.
C7d5bc5b054035d95f287797c2595694?d=identicon&s=25 matiassurdi (Guest)
on 2005-12-10 23:03
(Received via mailing list)
Nick Snels escribió:
>
> Kind regards,
>
> Nick
>


see this:

http://www.cookwood.com/html/extras/entities.html


bye
334ae822566107a2ea2b7a7cb88bd1d6?d=identicon&s=25 Brutyn Nick (Guest)
on 2005-12-12 11:32
(Received via mailing list)
hey,

read this http://article.gmane.org/gmane.comp.lang.ruby.rails/33858
this is how i solved my problem

cuz i also export to pdf and excel

if i used utf8:
-the website OK
-export pdfs and excels NOT OK

if i used iso-8859-1:
-the website NOT OK
-export pdfs and excels OK

so i set the charset for each def in all my controllers, this worked for
me.

Nick.
588b32371b62ebe36d70fa712a1173f0?d=identicon&s=25 Gerard J. Petersen (Guest)
on 2005-12-12 11:56
(Received via mailing list)
I'm not a RoR guru, but a fact is when using:

<meta http-equiv="Content-Type"
content="text/html;charset=ISO-8859-15"/>

(so charset "ISO-8859-15") in your HTML files there's no problem
displaying
chars like that, in my case pulled straight from a mysql db. (done with
a
perl script). I imagine this works as well for rails but you have to
figure
out what (read: where) to tell Rails.

Regards,

Gerard.

On Monday 12 December 2005 11:26, Brutyn Nick tried to type something
like:
>
>
>
>
> _______________________________________________
> Rails mailing list
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails

--
$biz = http://www.gp-net.nl ;
$fun = http://www.mrmental.com ;
~
~
:wq!
This topic is locked and can not be replied to.