UTF-8 as default charset?


#1

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?


#2

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:

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


#3

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.


#4

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


#5

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


#6

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.