[ZCM] [ZC] 2262/ 3 Comment "new convertToUnicode() broken"

"Collector: Zope Bugs, Features, and Patches ..." <[email protected]>
Newsgroups gmane.comp.web.zope.devel.collector-monitor
Message-ID <[email protected]>
Issue #2262 Update (Comment) "new convertToUnicode() broken"
 Status Accepted, Zope/bug critical
To followup, visit:
  http://www.zope.org/Collectors/Zope/2262

==============================================================
= Comment - Entry #3 by yuppie on Jan 11, 2007 9:08 am

> = Assign - Entry #2 by ajung on Jan 11, 2007 8:19 am
> b) you can't create a ZPT instance with a content-type other than
>   text/html or text/xml

It was possible in Zope 2.9 and older, so I guess code that converts persistent objects has to deal with other content-types as well.

The fact Zope 2.10 no longer supports other content-types seems to be a bug on its own, but that's a different issue.
________________________________________
= Assign - Entry #2 by ajung on Jan 11, 2007 8:19 am

 Status: Pending => Accepted

 Supporters added: andreasjung

a) clearly a bug
b) you can't create a ZPT instance with a content-type other than text/html or text/xml
________________________________________
= Request - Entry #1 by yuppie on Jan 11, 2007 7:56 am

There are two issues in Products.PageTemplates.utils.convertToUnicode:

1.) If charsetFromMetaEquiv(source) returns a value, it is ignored and a TypeError is raised. The sniffing result should be used for decoding instead.

2.) Other content-types than 'text/xml' or 'text/html' always trigger a ValueError. I guess it would be better to try decoding based on preferred_encodings.
==============================================================
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.