[Python-3000] Pre-PEP: Easy Text File Decoding

Paul Prescod paul at prescod.net
Sun Sep 10 20:14:07 CEST 2006


I went based on the current setdefaultencoding. But it seems that we will
accumulate 3 or 4 related functions so I'm pursuaded that there should be a
module.

encodingdetection.setdefaultfileencoding
encodingdetection.registerencodingdetector
encodingdetection.guessfileencoding(filename)
encodingdetection.guessfileencoding(bytestream)

Suggestion accepted.

On 9/10/06, Antoine Pitrou <solipsis at pitrou.net> wrote:
>
>
> > The Site Decoding Hook
> > ========================
> >
> > The "sys" module could have a function called
> > "setdefaultfileencoding". The encoding specified could be a true
> > encoding name or one of the encoding detection scheme names ( e.g.
> > "guess" or "XML").
>
> Isn't it more intuitive to gather functions based on what their
> high-level purpose is ("text" or "textfile") than implementation details
> of where the information comes from ("sys", "locale") ?
>
> That function could be "textfile.set_default_encoding" (with
> underscores), or even "text.textfile.set_default_encoding" (if all this
> resides in a "text" module).
>
> Regards
>
> Antoine.
>
>
> _______________________________________________
> Python-3000 mailing list
> Python-3000 at python.org
> http://mail.python.org/mailman/listinfo/python-3000
> Unsubscribe:
> http://mail.python.org/mailman/options/python-3000/paul%40prescod.net
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/python-3000/attachments/20060910/27244e91/attachment.html 


More information about the Python-3000 mailing list