diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2013-02-16 15:30:31 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2013-02-16 15:30:31 (GMT) |
commit | 0cad7eca45a3bd081fa0c2dd18e05c8202661cf9 (patch) | |
tree | 940e23e6f0193a32b141a5e0f91e6b350eacd540 /Doc/howto | |
parent | 165ee9645b6518f36c3ec23d0e64d2956e42c5c4 (diff) | |
parent | f8def28ff03f3167bd0becabab4dc5d70ee22033 (diff) | |
download | cpython-0cad7eca45a3bd081fa0c2dd18e05c8202661cf9.zip cpython-0cad7eca45a3bd081fa0c2dd18e05c8202661cf9.tar.gz cpython-0cad7eca45a3bd081fa0c2dd18e05c8202661cf9.tar.bz2 |
Issue #17193: Use binary prefixes (KiB, MiB, GiB) for memory units.
Diffstat (limited to 'Doc/howto')
-rw-r--r-- | Doc/howto/unicode.rst | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Doc/howto/unicode.rst b/Doc/howto/unicode.rst index 7500dce..3dafc8c 100644 --- a/Doc/howto/unicode.rst +++ b/Doc/howto/unicode.rst @@ -456,11 +456,11 @@ with ``bytes.decode(encoding)``. However, the manual approach is not recommende One problem is the multi-byte nature of encodings; one Unicode character can be represented by several bytes. If you want to read the file in arbitrary-sized -chunks (say, 1k or 4k), you need to write error-handling code to catch the case +chunks (say, 1024 or 4096 bytes), you need to write error-handling code to catch the case where only part of the bytes encoding a single Unicode character are read at the end of a chunk. One solution would be to read the entire file into memory and then perform the decoding, but that prevents you from working with files that -are extremely large; if you need to read a 2GB file, you need 2GB of RAM. +are extremely large; if you need to read a 2 GiB file, you need 2 GiB of RAM. (More, really, since for at least a moment you'd need to have both the encoded string and its Unicode version in memory.) |