[py-dev] Unicode support in py.log
Grig Gheorghiu
grig at gheorghiu.net
Wed Jul 13 17:11:05 CEST 2005
I was using the default STDOUT consumer in py.log when I ran into a
problem printing strings that contain non-ASCII characters. I think we
should modify at a minimum the 'content' method of the Message class in
producer.py so that it uses unicode as opposed to str. Here's what I
did temporarily to get past my problem:
def content(self):
return " ".join(map(unicode, self.args)).encode('utf-8')
Of course, the encoding should be configurable, but I'm not sure if
it's best to have it as a global variable in producer.py or some other
way.
Grig
More information about the py-dev
mailing list