Le vendredi 08 janvier 2010 03:23:08, MRAB a écrit : > Guido van Rossum wrote: > > I'm a little hesitant about this. First of all, UTF-8 + BOM is crazy > > talk. And for the other two, perhaps it would make more sense to have > > a separate encoding-guessing function that takes a binary stream and > > returns a text stream wrapping it with the proper encoding? > > Alternatively, have a universal UTF-8/16/32 encoding, ie one that > expects UTF-8, > with or without BOM, or UTF-16/32 with BOM.
Do you mean open(filename, encoding="BOM")? I suppose that "BOM" would be a magical value specific to read a text file (open(filename, "r")), not a real codec? Otherwise which encoding should be used for open(filename, "w", encoding="BOM")? -- Victor Stinner http://www.haypocalc.com/ _______________________________________________ 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