Re: Character encoding
"Alexander Limi" <limi-z4DKO/[email protected]>
| Newsgroups | gmane.comp.web.zope.plone.archetypes.devel |
|---|---|
| Organization | Plone Solutions · http://www.plone solutions.com |
| Message-ID | <[email protected]> |
On Tue, 04 Apr 2006 03:23:41 -0700, Raphael Ritz <[email protected]> wrote: > Stefan H. Holek wrote: >> The problem with guessing always is that you might guess wrong, >> causing problems that are harder to find by several orders of >> magnitude. I'd much rather say: your content must be in the configured >> site encoding, otherwise you are dead. Period. At least that's >> deterministic. ;-) > > While I agree in principle it just doesn't fit real life :-( > > And since we do have a function 'guess_encoding' in > > Products.MimetypesRegistry.encoding > > which in its current form is far from perfect, why not > improve it? > > Note that calling 'guess_encoding' already is only a > fallback for the mimetype tool, so whenever the encoding > is defined properly it shouldn't be called anyway. +1. Stefan, it doesn't really matter whether this thing is deterministic or not - the encoding detection just needs to figure out something where it can represent the incoming data, to convert it to unicode so it can be stored internally as that. The encoding detection scripts these days are really accurate, I haven't yet seen one fail when it has more than 5-10 characters to convert. As long as the output is deterministic, that's the important part. :) -- _____________________________________________________________________ Alexander Limi · Chief Architect · Plone Solutions · Norway Consulting · Training · Development · http://www.plonesolutions.com _____________________________________________________________________ Plone Co-Founder · http://plone.org · Connecting Content Plone Foundation · http://plone.org/foundation · Protecting Plone ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642