On 4/16/11 4:54 PM, nikolaj wrote:
Thanks Raphael for you answer. Still Im a bit confused about the utf-8
encoding. Please see below.

Hi Nikolaj,

[..]

    Module email.header, line 176, in __init__
    Module email.header, line 260, in append
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 5:
ordinal not in range(128)

Again, this is EasyNewsletter specific. It is creating an email message
and fails when
putting the title in the email subject line I assume.

Ok, so I can not do anything about that one.

Actually you can.

As you point out below yourself there is an option
to change the default encoding used by Python.

Whether that's using sitecustomize.py (Python2.4
and older) or site.py (newer Python versions) or
custom code doesn't really matter.

http://diveintopython.org/xml_processing/unicode.html
I consider a good background reading for the
general issue (you would use utf-8 as default).

While we typically recommend not to mess with the
default encoding this applies more to developers
than users as developers run the risk to create
exactly the kind of issues you are seeing if they
do.

HTH,

        Raphael



2011-04-08T21:04:44 INFO ZPublisher.Conflict ConflictError at
/VirtualHostBase/http/basse:80/vaio/VirtualHostRoot/Members/admin/basse-nyheder/det-forste-nyhedsbrev/edit:
database conflict error (oid 0x12a7, class
Products.EasyNewsletter.content.ENLIssue.ENLIssue) (1 conflicts (0
unresolved) since startup at Fri Apr  8 20:39:42 2011)

As long as you don't see many of those I wouldn't care much about this.
They happen.
As long as they can be resolved it's no problem.

Ok.


utf-8: now able to save, but when sending with ø in title:


2011-04-09T11:56:09 ERROR Zope.SiteErrorLog 1302342969.10.994456186908
http://basse/Members/admin/basse-nyheder/det-forste-issue-og-ikke-helt/send-issue
Traceback (innermost last):
    Module ZPublisher.Publish, line 127, in publish
    Module ZPublisher.mapply, line 77, in mapply
    Module ZPublisher.Publish, line 47, in call_object
    Module Products.EasyNewsletter.browser.issue, line 19, in send_issue
    Module Products.EasyNewsletter.content.ENLIssue, line 364, in send
    Module email.header, line 176, in __init__
    Module email.header, line 260, in append
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 5:
ordinal not in range(128)

This is the same as above. Obviously, EasyNewsletter should exercise more
care when>  accessing potentially non-ascii encoded content.
Wild guess: Does it do something similar to

   context.title

rather than

   context.Title()

where context is a content item?

How do I test that (again, Im new to Plone).


2011-04-09T11:12:08 INFO ZPublisher.Conflict ConflictError at
/VirtualHostBase/http/basse:80/vaio/VirtualHostRoot/Members/admin/portal_factory/EasyNewsletter/easynewsletter.2011-04-09.3248375499/kssValidateField:
database conflict error (oid 0x0551, class BTrees.IOBTree.IOBTree, serial
this txn started with 0x038d85c8192609cc 2011-04-09 09:12:05.894200,
serial
currently committed 0x038d85c825204522 2011-04-09 09:12:08.701419) (1
conflicts (0 unresolved) since startup at Sat Apr  9 11:04:11 2011)

Hm, like the previous issues this hints at something being wrong in how
EasyNewsletter>  handles titles. Doesn't seem to be unicode safe.

I hear what you say, all in all it is EasyNewsLetter that does not handle
"æøå" in the title. PS I must say that it works in the body (so I can live
with it for a while).

But, Im still a bit confused about encoding, so when I see an encoding error
I my initial thought is that I did something wrong.  As said, Im from
Denmark and we use danish letters ("æøå") and my initial guess is that the
best way to go is with Unicode (utf-8). But of course, if the product is not
Unicode ready then its out of my control.

Anyway, this is what I found out until now - it does not matter how the
FreeBSD encoding is set in .cshrc (with LC_CTYPE etc.) - it only matters how
the applications - in this case - Python, Plone, Apache and Postgresql is
configured (unless they of course read the configuration choice from the
.cshrc - which I do not think they do). In other words, I could use
ISO8859-1 for my FreeBSD and UTF-8 for the site - if I want. Please comment
on that (I wont put out some garbage that people think works).

Please also comment on "site.py" and "sitecustomize.py" in the light of
utf-8 - should be of any concern for my "æøå" setup.

Again thanks, your help is appreciated.
Nikolaj

--
View this message in context: 
http://plone.293351.n2.nabble.com/Plone-4-0-4-EasyNewsletter-and-UTF-8-encoding-on-FreeBSD-tp6257087p6279075.html
Sent from the Installation, Setup, Upgrades mailing list archive at Nabble.com.
_______________________________________________
Setup mailing list
Setup@lists.plone.org
https://lists.plone.org/mailman/listinfo/setup


_______________________________________________
Setup mailing list
Setup@lists.plone.org
https://lists.plone.org/mailman/listinfo/setup

Reply via email to