mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
Add constants BOM_UTF8, BOM_UTF16, BOM_UTF16_LE, BOM_UTF16_BE,
BOM_UTF32, BOM_UTF32_LE and BOM_UTF32_BE that represent the Byte Order Mark in UTF-8, UTF-16 and UTF-32 encodings for little and big endian systems. The old names BOM32_* and BOM64_* were off by a factor of 2. This closes SF bug http://www.python.org/sf/555360
This commit is contained in:
parent
bc48826dc2
commit
474458da48
3 changed files with 53 additions and 27 deletions
|
|
@ -142,16 +142,21 @@ for reading and writing to platform dependent files:
|
|||
\begin{datadesc}{BOM}
|
||||
\dataline{BOM_BE}
|
||||
\dataline{BOM_LE}
|
||||
\dataline{BOM32_BE}
|
||||
\dataline{BOM32_LE}
|
||||
\dataline{BOM64_BE}
|
||||
\dataline{BOM64_LE}
|
||||
These constants define the byte order marks (BOM) used in data
|
||||
streams to indicate the byte order used in the stream or file.
|
||||
\constant{BOM} is either \constant{BOM_BE} or \constant{BOM_LE}
|
||||
depending on the platform's native byte order, while the others
|
||||
represent big endian (\samp{_BE} suffix) and little endian
|
||||
(\samp{_LE} suffix) byte order using 32-bit and 64-bit encodings.
|
||||
\dataline{BOM_UTF8}
|
||||
\dataline{BOM_UTF16}
|
||||
\dataline{BOM_UTF16_BE}
|
||||
\dataline{BOM_UTF16_LE}
|
||||
\dataline{BOM_UTF32}
|
||||
\dataline{BOM_UTF32_BE}
|
||||
\dataline{BOM_UTF32_LE}
|
||||
These constants define various encodings of the Unicode byte order mark
|
||||
(BOM) used in UTF-16 and UTF-32 data streams to indicate the byte order
|
||||
used in the stream or file and in UTF-8 as a Unicode signature.
|
||||
\constant{BOM_UTF16} is either \constant{BOM_UTF16_BE} or
|
||||
\constant{BOM_UTF16_LE} depending on the platform's native byte order,
|
||||
\constant{BOM} is an alias for \constant{BOM_UTF16}, \constant{BOM_LE}
|
||||
for \constant{BOM_UTF16_LE} and \constant{BOM_BE} for \constant{BOM_UTF16_BE}.
|
||||
The others represent the BOM in UTF-8 and UTF-32 encodings.
|
||||
\end{datadesc}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue