Forum: Typo utf-8 problems

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.
Frithjof Eckhardt (Guest)
on 2007-04-19 12:59
(Received via mailing list)
Hi,

I have some problems with utf-8 configuration with my blog
(www.rubykids.de).

It's
o Typo 4.0
o database collation set to utf8_unicode_ci (database and all the
tables)
o database.yml contains "encoding:utf8"
o database content is utf8 (checked via export and Vi)
o Typo seems to send response header Content-Type="text/html;
charset=utf-8"
correctly
o I manually added a before_filter to application.rb with the on line:
 @headers["Content-Type"] = "text/html;charset=UTF-8"
I did this after the problem occured the first time, but it seems to be
worthless.


Now I have the strange effect that after some days/weeks all special
characters (especially german umlauts)
are displayed encoded incorrectly. It looks very ugly and
unprofessional. I
found out that the following
workaround helps:
o sweep the Typo cache
o force fastcgi process to restart

Sometimes I have to do both twice.

Has anybody encountered similar effects? Is there a known bug I am not
aware
of?
Any help is extremely appreciated.

Thanks in advance.

Cheers!
Frithjof
Trejkaz (Guest)
on 2007-04-20 13:40
(Received via mailing list)
On Thursday 19 April 2007 18:58, Frithjof Eckhardt wrote:
> Has anybody encountered similar effects? Is there a known bug I am not
> aware of?
> Any help is extremely appreciated.

I've had this happen to me but in all situations, looking at the
response
headers showed that it wasn't sending UTF-8.

I'm not sure if it was due to caching or whatnot, but explicitly
adding "AddDefaultCharset utf-8" to public/.htaccess solved the problem
for
me.

TX
Frithjof Eckhardt (Guest)
on 2007-04-20 15:27
(Received via mailing list)
I will try it, thanks. But what is strange to me is that the content
itself
arriving at my browser is wrongly encoded already and as I anderstand
the
"content-type" thing, it tells the browser only how to interpret the
content. So when the characters are arriving crumbled, the browser has
no
chance anymore to display something meeningful.

2007/4/20, Trejkaz <removed_email_address@domain.invalid>:
This topic is locked and can not be replied to.