Problems with COREBlog and page encoding
June 2019
Sun Mon Tue Wed Thu Fri Sat
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
This site is an effort to share some of the base knowledge I have gathered through all this years working with Linux, FreeBSD, OpenBSD, Python or Zope, among others. So, take a look around and I hope you will find the contents useful.
Recent Entries
Recent Comments
Recent Trackbacks
OpenBSD (9 items)
BSD (0 items)
FreeBSD (19 items)
Linux (3 items)
Security (3 items)
Python (22 items)
Zope (13 items)
Daily (144 items)
e-shell (9 items)
Hacks (14 items)
PostgreSQL (3 items)
OSX (8 items)
Nintendo DS (0 items)
enlightenment (0 items)
Apache (3 items)
Nintendo Wii (1 items)
Django (24 items)
Music (12 items)
Plone (7 items)
Varnish (0 items)
Lugo (2 items)
Sendmail (0 items)
europython (7 items)
Cherokee (1 items)
self (1 items)
Nature (1 items)
Hiking (0 items)
uwsgi (0 items)
nginx (0 items)
cycling (10 items)
Networking (1 items)
DNS (0 items)

Syndicate this site (XML)

RSS/RDF 0.91

02 noviembre

Problems with COREBlog and page encoding

or how you shouldn't mix different charsets...

Probably most of you who speak spanish noticed that my posts that were written in than language appeared corrupted until some hours ago.

Well, basically the problem was that everything in this blog is managed in UTF-8 while (I still don't know why) COREBlog itself is encoding all the pages as ISO-8859-15 before serving them. Of course that caused that all the spanish special characters (accented vocals, the famous ñ and some more) appeared as strange symbols on screen.

The solution to that problem is really easy, I only had to add a single line to the blog_header DTML method inside my skin folder:

<dtml-call "REQUEST.RESPONSE.setHeader('Content-Type', 'text/html; charset=utf-8')">

That forced COREBlog to set the proper content-type in each page headers (to UTF-8).

Posted by wu at 02:24 | Comments (0) | Trackbacks (0)
<< OpenBSD 4.2 released | Main | OSx, core files and disk space >>
Re: Problems with COREBlog and page encoding

Congratulations for catching this! No idea why it's needed though, seems to work fine with me here...

Posted by: betabug at noviembre 02,2007 14:06
Re: Problems with COREBlog and page encoding

Was difficult to find, and only after a lot of googling I could find that solution.

Anyway, it is still a mistery why COREBlog was encoding pages as iso-8859-15, I searched through the source code of the Product, the skin DMTL methods, the configs, and no reference at all for that charset.

Ah!, and it is not Zope's fault, cause the rest of the Products (Zwiki for example) are working fine.

Posted by: Wu at noviembre 02,2007 14:27
Re: Problems with COREBlog and page encoding

Well, of course I know that the header usually has to be set in Zope products output. But what I wonder about is why this wasn't necessary for me. I've double checked, and I don't have that setHeader anywwhere. I also wonder why it wasn't set in COREBlog code already.

Maybe it's because you are already on Zope 2.10 - it could be that 2.10 is picking up the locale or something.

Posted by: betabug at noviembre 03,2007 09:50
Re: Problems with COREBlog and page encoding

As I've just upgraded my Zope to 2.9 (yeah, I'm way too conservative) I noticed the same problem here. In addition, I had the problem in my wikis too. Since I knew that the upgrade to 2.9 was what had changed, I grepped through the instance directory for 8859-15... and discovered that it's the default for "default-zpublisher-encoding" in zope.conf.

Changing to 'default-zpublisher-encoding utf-8' solved the problems for my wikis, I had already applied the same line as you in coreblog, but I guess it could have solved the coreblog problem too.

Posted by: betabug at noviembre 11,2007 17:40
Re: Problems with COREBlog and page encoding

YES!, found it. I 2.10 default-zpublisher-encoding defaults to iso-8859-15 too... interesting... Will try setting it to utf-8 and deleting the utf-8 header hack from COREBlog.

Thnx for pointing to that betabug.

Posted by: Wu at noviembre 12,2007 00:37
Please send trackback to:
There are no trackbacks.
Post a comment