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.<br><br>encodingdetection.setdefaultfileencoding<br>encodingdetection.
<span style="font-family: courier new,monospace;">registerencodingdetector<br>encodingdetection.guessfileencoding(filename)<br></span><span style="font-family: courier new,monospace;">encodingdetection.guessfileencoding(bytestream)
</span><br><br>Suggestion accepted.<br><br><div><span class="gmail_quote">On 9/10/06, <b class="gmail_sendername">Antoine Pitrou</b> <<a href="mailto:solipsis@pitrou.net">solipsis@pitrou.net</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>> The Site Decoding Hook<br>> ========================<br>><br>> The "sys" module could have a function called<br>> "setdefaultfileencoding". The encoding specified could be a true<br>
> encoding name or one of the encoding detection scheme names ( e.g.<br>> "guess" or "XML").<br><br>Isn't it more intuitive to gather functions based on what their<br>high-level purpose is ("text" or "textfile") than implementation details
<br>of where the information comes from ("sys", "locale") ?<br><br>That function could be "textfile.set_default_encoding" (with<br>underscores), or even "text.textfile.set_default_encoding
" (if all this<br>resides in a "text" module).<br><br>Regards<br><br>Antoine.<br><br><br>_______________________________________________<br>Python-3000 mailing list<br><a href="mailto:Python-3000@python.org">
Python-3000@python.org</a><br><a href="http://mail.python.org/mailman/listinfo/python-3000">http://mail.python.org/mailman/listinfo/python-3000</a><br>Unsubscribe: <a href="http://mail.python.org/mailman/options/python-3000/paul%40prescod.net">
http://mail.python.org/mailman/options/python-3000/paul%40prescod.net</a><br></blockquote></div><br>