PEP 540: correcting english errors
This commit is contained in:
parent
1f1abb3b6a
commit
a525758390
12
pep-0540.txt
12
pep-0540.txt
|
@ -60,12 +60,12 @@ These users expect that Python 3 "just works" with any locale and don't
|
|||
bother them with encodings. From their point of the view, the bug is not
|
||||
their locale but is obviously Python 3.
|
||||
|
||||
Since Python 2 handles data as bytes, it's more rare in Python 2
|
||||
Since Python 2 handles data as bytes, it's rarer in Python 2
|
||||
compared to Python 3 to get Unicode errors. It also explains why users
|
||||
also perceive Python 3 as the root cause of their Unicode errors.
|
||||
|
||||
Some users expect that Python 3 just works with any locale and so don't
|
||||
bother of mojibake, whereas some developers are working hard to prevent
|
||||
bother with mojibake, whereas some developers are working hard to prevent
|
||||
mojibake and so expect that Python 3 fails early before creating
|
||||
mojibake.
|
||||
|
||||
|
@ -185,7 +185,7 @@ On Mac OS X, Windows and Android, Python always use UTF-8 for operating
|
|||
system data. For Windows, see the PEP 529: "Change Windows filesystem
|
||||
encoding to UTF-8".
|
||||
|
||||
On Linux, UTF-8 became the defacto standard encoding,
|
||||
On Linux, UTF-8 became the de facto standard encoding,
|
||||
replacing legacy encodings like ISO 8859-1 or ShiftJIS. For example,
|
||||
using different encodings for filenames and standard streams is likely
|
||||
to create mojibake, so UTF-8 is now used *everywhere*.
|
||||
|
@ -208,7 +208,7 @@ information on the UTF-8 codec.
|
|||
Old data stored in different encodings and surrogateescape
|
||||
----------------------------------------------------------
|
||||
|
||||
Even if UTF-8 became the defacto standard, there are still systems in
|
||||
Even if UTF-8 became the de facto standard, there are still systems in
|
||||
the wild which don't use UTF-8. And there are a lot of data stored in
|
||||
different encodings. For example, an old USB key using the ext3
|
||||
filesystem with filenames encoded to ISO 8859-1.
|
||||
|
@ -241,7 +241,7 @@ the ASCII encoding.
|
|||
|
||||
The problem is that operating system data like filenames are decoded
|
||||
using the ``surrogateescape`` error handler (PEP 383). Displaying a
|
||||
filename to stdout raises an Unicode encode error if the filename
|
||||
filename to stdout raises a Unicode encode error if the filename
|
||||
contains an undecoded byte stored as a surrogate character.
|
||||
|
||||
Python 3.6 now uses ``surrogateescape`` for stdin and stdout if the
|
||||
|
@ -661,7 +661,7 @@ Always use UTF-8
|
|||
----------------
|
||||
|
||||
Python already always use the UTF-8 encoding on Mac OS X, Android and Windows.
|
||||
Since UTF-8 became the defacto encoding, it makes sense to always use it on all
|
||||
Since UTF-8 became the de facto encoding, it makes sense to always use it on all
|
||||
platforms with any locale.
|
||||
|
||||
The risk is to introduce mojibake if the locale uses a different encoding,
|
||||
|
|
Loading…
Reference in New Issue