Forum: Radiant CMS UTF-8 as default charset?

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.
Ollivier R. (Guest)
on 2006-06-02 19:11
(Received via mailing list)
It seems that by default radiant/mongrel sens out HTTP headers with
charset="ISO-8859-1" (the standard for text/html where as I want it to
send UTF-8 as all my pages are XHTML compliant and in UTF-8.

<?xml version="1.0" encoding="utf-8" ?>

in the layout doesn't seem to make any difference.

Any idea?
Pawel S. (Guest)
on 2006-06-02 23:18
(Received via mailing list)
On 6/2/06, Ollivier R. <removed_email_address@domain.invalid> wrote:
> It seems that by default radiant/mongrel sens out HTTP headers with
> charset="ISO-8859-1" (the standard for text/html where as I want it to
> send UTF-8 as all my pages are XHTML compliant and in UTF-8.
>
> <?xml version="1.0" encoding="utf-8" ?>
>
> in the layout doesn't seem to make any difference.
>
> Any idea?

Try this in the head section of your layout:

<meta http-equiv="Content-type" content="text/html; charset=utf-8" />

Or go into application.rb, and add this as one of the before_filters:

  def set_charset
    @headers["Content-Type"] = "text/html; charset=utf-8"
  end

That will probably get overwritten  next time you do an svn update on
the source tree. Maybe it'd be better to make a plugin.. something
like lib/plugins/utf8/init.rb that just modified BaseBehavior and
forces it to send a utf8 header?

-Pawel
John W. Long (Guest)
on 2006-06-03 08:26
(Received via mailing list)
Ollivier R. wrote:
> It seems that by default radiant/mongrel sens out HTTP headers with
> charset="ISO-8859-1" (the standard for text/html where as I want it to
> send UTF-8 as all my pages are XHTML compliant and in UTF-8.
>
> <?xml version="1.0" encoding="utf-8" ?>
>
> in the layout doesn't seem to make any difference.
>
> Any idea?

Have you tried setting the content type and charset on the layout? There
is a new field for this in the latest version of Radiant.

--
John L.
http://wiseheartdesign.com
Ollivier R. (Guest)
on 2006-06-06 14:30
(Received via mailing list)
On 6/3/06, John W. Long <removed_email_address@domain.invalid> wrote:
> Have you tried setting the content type and charset on the layout? There
> is a new field for this in the latest version of Radiant.

Found it behind the "more..." button.  Thanks, seems to work fine.
Ollivier R. (Guest)
on 2006-06-07 19:18
(Received via mailing list)
On 6/3/06, John W. Long <removed_email_address@domain.invalid> wrote:
> Have you tried setting the content type and charset on the layout? There
> is a new field for this in the latest version of Radiant.

As can be seen at http://new.keltia.net/ it now works for the iste
itself.

Now, how can I force the /admin/ pages to be utf-8 as well, by default,
for form for editing a given page is in iso8859-1 and I have to force
utf-8.

Thanks.
John W. Long (Guest)
on 2006-06-08 05:24
(Received via mailing list)
Ollivier R. wrote:
> On 6/3/06, John W. Long <removed_email_address@domain.invalid> wrote:
>> Have you tried setting the content type and charset on the layout? There
>> is a new field for this in the latest version of Radiant.
>
> As can be seen at http://new.keltia.net/ it now works for the iste itself.
>
> Now, how can I force the /admin/ pages to be utf-8 as well, by default,
> for form for editing a given page is in iso8859-1 and I have to force utf-8.

Can you create a patch for this? I'm fine with the admin interface
running on UTF-8 as long as it doesn't cause problems for others.

--
John L.
http://wiseheartdesign.com
This topic is locked and can not be replied to.