On Nov 12, 2007, at 8:56 AM, Walter Dörwald wrote: > It isn't "embedded". codecs.detect_xml_encoding() is callable without > any problems (though not documented). "Not documented" means not available, I think. > Who would use such a function for what? Being able to detect the encoding can be useful anytime you want information about a file, actually. In particular, presenting encoding information in a user interface (yes, you can call that contrived, but some people want to be able to see such things, and for them it's a requirement). If you want to parse the XML and re-encode, it's common to want to re-encode in the origin encoding; it's needed for that as well. If you just want to toss the text into an editor, the encoding is also needed. In that case, the codec approach *might* be acceptable (depending on the rest of the editor implementation), but the same re-encoding issue applies as well. Simply, it's sometimes desired to know the encoding for purposes that don't require immediate decoding. A function would be quite handing in these cases. -Fred -- Fred Drake <fdrake at acm.org>
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4