Message107467
| Author |
lemburg |
| Recipients |
lars.gustaebel, lemburg, loewis, vstinner |
| Date |
2010年06月10日.17:27:25 |
| SpamBayes Score |
6.141669e-05 |
| Marked as misclassified |
No |
| Message-id |
<4C11207A.2060102@egenix.com> |
| In-reply-to |
<1276190344.13.0.674254471941.issue8784@psf.upfronthosting.co.za> |
| Content |
STINNER Victor wrote:
>
> STINNER Victor <victor.stinner@haypocalc.com> added the comment:
>
> My tests with 7-zip and WinRAR conviced me that it's not a good idea to use utf-8 *by default* on Windows. But since mbcs doesn't support surrogateescape error handler, we should restore the previous behaviour just for this encoding.
>
> tarfile_mbcs_errors.patch creates a function choose_errors() which determine the best error handler depending on the encoding and the mode (read or write):
> - "strict" to write with mbcs
> - "replace" to read with mbcs
> - "surrogateescape" otherwise
I think you should implement this in a more general way:
have the class test whether the codec supports "surrogateescape"
and then use it. Otherwise fall back to "strict" for writing
and "replace" for reading. |
|