[Python-Dev] PEP 528: Change Windows console encoding to UTF-8 (original) (raw)
Paul Moore p.f.moore at gmail.com
Mon Sep 5 16:08:46 EDT 2016
- Previous message (by thread): [Python-Dev] PEP 528: Change Windows console encoding to UTF-8
- Next message (by thread): [Python-Dev] PEP 528: Change Windows console encoding to UTF-8
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 5 September 2016 at 20:30, Steve Dower <steve.dower at python.org> wrote:
The only case we can reasonably handle at the raw layer is "n / 4" is zero but n != 0, in which case we can read and cache up to 4 bytes (one wchart) and then return those in future calls. If we try to cache any more than that we're substituting for buffered reader, which I don't want to do.
Does caching up to one (Unicode) character at a time sound reasonable? I think that won't be much trouble, since there's no interference between system calls in that case and it will be consistent with POSIX behaviour.
Caching a single character sounds perfectly OK. As I noted previously, my use case probably won't need to work at the raw level anyway, so I no longer expect to have code that will break, but I think that a 1-character buffer ensuring that we avoid surprises for code that was written for POSIX is a good trade-off.
Paul
- Previous message (by thread): [Python-Dev] PEP 528: Change Windows console encoding to UTF-8
- Next message (by thread): [Python-Dev] PEP 528: Change Windows console encoding to UTF-8
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]