Hello,

My app started throwing unicode errors, and I've tracked it down to the fact I 
have accents in .metadata files.

This becomes a problem when a unicode string sneaks into the page to be 
rendered, at which time StringIO.getvalue() bombs.

Normally I'd try to get rid of the unicode string, but in this case it seems 
like it's coming from the i18n machinery (The result of a translation), and as 
such, might not be very desirable for me to mess with it.

For example I have an FSImage with a title that in french contains an accented 
character.

When calling the tag() method on the image, I end up with a <type 'str'> with 
high bit characters.

The same page will contain i18n:translate results, which are unicode.

And voila.

I tried making the FSMetadata logic return a unicode string instead of a 
regular string, but that didn't work (not too clear on why, the logging module 
started throwing errors?).

I also tried using HTML entities such as &eacute; in there, but looks like HTML 
title= or alt= doesn't render them?

Anyone have any ideas how I might get around this?  I'm out of ideas :(

Thanks,

Jean-François Doyon
Internet Service Development and Systems Support / Spécialiste de 
dèveloppements internet et soutien technique
Canada Centre for Remote Sensing/Centre Canadien de télédétection
Natural Resources Canada/Ressources Naturelles Canada
http://atlas.gc.ca
Tel./Tél.: (613) 992-4902
Fax: (613) 947-2410
_______________________________________________
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests

Reply via email to