"Martin v. Löwis" writes: > > It's clear to me that detecting an encoding is actually the simplest > > part of all this (so long as there's an API to do it!) Putting it > > inside a codec seems like the wrong subdivision of responsibility. > > In case it isn't clear - this is exactly my view also.
But is there an API to do it? As MAL points out that API would have to return not an encoding, but a pair of an encoding and the rewound stream. For non-seekable, non-peekable streams (if any), what you'd need would be a stream that consisted of a concatenation of the buffered data used for detection and the continuation of the stream. _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com